Thank you for reading my thread,I am new to C and I have a big problem -Naturally.I cant seem to compile thise code:
# define EOF =-1
main()
{
int c,nl; // integers
nl = 0; // assignment int ln to 0 value
while ((c = getchar() !=EOF) // problem area :-(
if (c =='\n') // here I believe the '\n' char means new line
++nl;
printf("%d\n",nl);
}
The purpose of the code is to count the number of keys pressed :rolleyes:
but regardless of that, my problem start when I compile the code - it outputs error with 'while' line7 after = but other times :sad: error after ; which I obviously do not have:confused:
I am running on linux and my compiler is some strange application I read about in some dump e-book I downloaded some where(can't remember URL :sad: ) a few years ago called cc.