0
Can't write getchar, gets like below?if so, why?
char a; getchar(a); And, Char a[100] = gets(a);
1 ответ
+ 3
Hi!
The function prototype of getchar() is: int getchar ( void );
That's why getchar(a); is incorrect... it should be: a = getchar();
And when you try to do:
char a[100] = gets(a);
Throws an error because char a[100] can be initialized at compile time but not at runtime; gets(a) returns a string from user... (at runtime)