Question: In C, I am writing a program which take a string as input, and then put it into an character array. I have code like
In C, I am writing a program which take a string as input, and then put it into an character array.
I have code like this.
char guess[20];
scanf("%s",&guess);
The code works fine but it keep give me a warning,
/autograder/submission/moo.c:111:12: error: format %s expects argument of type char *, but argument 2 has type char (*)[20] [-Werror=format=] scanf("%s",&guess);} I sort of understand what it says but have no idea how to fix it...
please help! thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
