|
From: Jan M. <jan...@vo...> - 2007-07-16 12:04:05
|
Hello,
I have got a problem I don't understand very much.
I have in my code:
#include<stdio.h>
int main()
{
char str[10];
getchar ();
gets (str);
printf ("%s\n", str);
return 0;
}
In this case it seems the program is ignoring the
"gets ()" command. After I press some key and >CR>It stops and doesn't wait
for line input. If I do not have there the "getchar () I can input a line.
It runs in Windows console (Command Prompt).
I feel it is some stupid error of me but I don't know where
Thank you
Jan Mura
|