Re: [newbie]C code does not Run.
Re: [newbie]C code does not Run.
- Subject: Re: [newbie]C code does not Run.
- From: Cameron Hayne <email@hidden>
- Date: Wed, 09 Oct 2002 11:23:47 -0400
On 9/10/02 10:26 am, "kunikyo" <email@hidden> wrote:
>
c = getchar();
>
while (c != EOF) {
>
putchar(c);
>
c = getchar();
>
}
>
[...]
>
Build is OK. But this code does not work. I input a character by
>
keyboard but this
>
code does not work. Nothing was displayed.
Are you typing Return after each character (or at least once in a while)?
You need to type a Return or else your keyboard input is not sent along to
your program. This is just a fact of life when using the stdio functions
which are buffered. Not something particular to Obj-C or OS X - this is the
way it works on all platforms.
You might find the C FAQ useful (see especially question 19.1):
http://www.eskimo.com/~scs/C-faq/top.html
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.