Friday, 13 September 2013

format '%s' expects argument of type 'char *', but argument 2 has type 'char **'

format '%s' expects argument of type 'char *', but argument 2 has type
'char **'

I have this C code:
#include <stdio.h>
#include <stdlib.h>
int main(){
char *bitstr;
printf("Enter a bitstring or q for quit: ");
scanf("%s", &bitstr);
return 0;
}
I keep receive the following error. What am I doing wrong?
warning: format '%s' expects argument of type 'char *', but
argument 2 has type 'char **' [-Wformat]

No comments:

Post a Comment