Re: [cc65-devel] c64 - getting seemingly random chars on screen
cc65 - a freeware C compiler for 6502 based systems
Brought to you by:
gpz
|
From: <gr...@gm...> - 2021-03-03 19:21:21
|
Am Mittwoch, 3. März 2021, 20:15:14 CET schrieb Michael Parson:
> I guess the next question is... why doesn't the X-16 behave the same
> way?
A bug in it's conio library perhaps? or you are "printing" somewhere else in
memory that isnt the screen (this could also happen eg if you port this
program to vic20, which has a much smaller screen)
>
> As far as compiler/language bugs go, is what I'm seeing with 'cscanf()'
> expected behavior?
>
> #include <conio.h>
>
> int main() {
> unsigned char name[16];
>
> clrscr ();
>
> cprintf ("what is your name? ");
> cscanf ("%s", &name);
> cprintf ("hello, %s\n", name);
>
> return 0;
> }
>
> Start typing something at the prompt, hit backspace and it treats it
> like a return instead?
It's probably expected, scanf doesnt really handle "editing". i'd generally
avoid using it except for "testcode" - for "production code" you probably want
a custom textentry function that handles editing properly.
--
http://hitmen.eu http://ar.pokefinder.org
http://vice-emu.sourceforge.net http://magicdisk.untergrund.net
Sie werden hinnehmen müssen, daß der Gesetzgeber in Sachen
Vorratsdatenspeicherung anderer Meinung ist als Sie. Vorratsdatenspeicherung
hat mit Terrorismusbekämpfung relativ wenig zu tun. Ich wäre für die
Vorratsdatenspeicherung auch dann, wenn es überhaupt keinen Terrorismus gäbe.
<Dieter Wiefelspütz , SPD>
|