I am trying to run a simple C program but I am getting this error:
warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[20]’
Running Mac OSX Mountain Lion, compiling in terminal using gcc 4.2.1
#include <stdio.h>
int main() {
char me[20];
printf("What is your name?");
scanf("%s", &me);
printf("Darn glad to meet you, %s!
", me);
return (0);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…