I am trying to read input using scanf
and storing into char *
dynamically as specified by GCC manual, But it is giving a compile time error.
char *string;
if (scanf ("%as",&string) != 1){
//some code
}
else{
printf("%s
", *string);
free(string);
//some code
}
See Question&Answers more detail:os