+ 1
What the compiler errors? What does it mean?
The program is output right answer, but the compiler is going errors: #include <stdio.h> int main() { char* str="Grr"; str="Lion"; scanf("%s\n"); printf("%s\n", str); return 0; }
8 Antworten
+ 5
Clear @Martin Tylor thanks.Then you have to declare char pointer to store the input from the user ,then this char pointer will be the argument for scanf
char *string[100];
scanf("%s",string);
+ 2
Here scanf is without argument?
+ 2
It turns out - yes
+ 1
Which arguments will be correct then?
0
The input will be given by the user you don't know what is the string that will be given in each case you are tested for.So i think scanf is not the good function to use for string or array of char in c.