Hey, I've got a problem with some code I wrote.
I keep getting the error: "subscripted value is neither array nor pointer", I wont post the original code, 'cause it's kinda long, but I replicated the error with this:
Code:
#include <stdio.h>
int main()
{
printf("\n");
int i;
char Guess;
char Ans[1][4]={"A""B""C""D"};
printf("Enter Guess: ");
scanf("%c",&Guess);
printf("\n");
for (i=0;i<4;i++)
{ if(Guess[i]==Ans[i])
{ printf("Letter %d is correct!\n",(i+1));
}
}
printf("\n");
return 0;
}
The error points to
Code:
if(Guess[i]==Ans[i])
I'm kinda new to coding, and i suspect it is rather obvious, but... help!