我有一个令人沮丧的问题。我收到以下错误:
不兼容的指针类型将 'char*' 传递给 FILE*' 类型的参数(又名 'struct__sFILE*')”。
任何人都知道我将如何解决这个问题?
void load_myFile(char my_file_name[]) {
if(my_file_name != NULL) {
int op_code, L_code, M_code, i = 0;
while(my_file_name != NULL) {
fscanf(my_file_name, "%d", &op_code);
if(i > MAX_CODE_LENGTH) {
printf("Program is longer than MAX_CODE_LENGTH\n");
exit(ERROR_PROG_TOO_LONG);
}
fscanf(my_file_name, "%d", &L_code);
fscanf(my_file_name, "%d", &M_code);
code[i].op = op_code;
code[i].l = L_code;
code[i].m = M_code;
i++;
}
code_size = i;
}