So I am attempting to read in all the components of a line using the sscanf function like this:
char *R1;
char *R2;
int immediate;
char mnemonic[6];
FILE *input = fopen("file.txt","r");
...
sscanf(input, "%s %s %s %d", mnemonic, R1, R2, immediate);
When I compile, I am given the following warning:
Warning: passing argument 1 pf 'sscanf' from incompatible pointer type note: expected const char * restrict but argument is of type 'struct FILE *'
I suspect that this warning is the reason my code is failing to execute as intended, could someone please try to explain what the problem could be?
Aucun commentaire:
Enregistrer un commentaire