This is the main.
int
main(int argc, char *argv[]) {
char statement[MAX_LINE];
int statement_len;
char type[MAX_LINE];
char var[MAX_LINE];
/* Print the output header comment */
printf(OUTPUT_HEADER, argv[0]);
/* Loop through statements read on stdin */
while ((statement_len = next_statement(statement,MAX_LINE)) > 0) {
printf("%s;\n",statement);
sscanf(statement,"%s %s",type,var);
var_lib_check(type,var);
var_replace(statement,statement_len);
}
return 0;
}
This is the function where the error occurs.
void
var_replace(char statement, int statement_len){
int i;
int x;
for (i = 0; i < statement_len; i++){
for (x = 0; x < num_of_var; x++){
if (strcmp(var_library[x],statement[i]) == 0){
printf("hello");
}
}
}
return;
}
The error:
expected '=', ',', ';', 'asm' or 'attribute' before '{' token
How do I fix this?
Aucun commentaire:
Enregistrer un commentaire