I need to loop through a char array containing a line read by fgets and check for the '&' character. I thought that fgetc or getc might do the trick, but it seems that they can only recieve a FILE *stream, not an array. This is what i tried:
Code:
void run (char cur[]) {
char c;
char flag;
c = fgetc(cur); // or getc
while(c != EOF){
if(c == '&') {
printf("you wrote & char\n");
flag = 'y';
} else {
printf("you didn't write the & char\n");
}
}
"Passing arg 1 of 'fgetc' from incompatible pointer type."