Use pointer without Initialization isan error
char *s;
scanf("%s", s); Error: pointer has no value!
Correct one should be:
char *s;
char str[10];
s = str;
scanf("%s", s);
or scanf("%s", str);
or scanf("%s", &str[0]);
But
scanf("%s", &s);
is wrong.
Previous slide
Next slide
Back to first slide
View graphic version