warning: passing argument 2 of ‘fopen’ makes pointer from integer without a cast
问题 I have this function to check if a file exists: #include <stdio.h> int main(int argc, char **argv) { int textFileExists(const char *filename){ FILE *fp= fopen(filename,'r'); if(fp==NULL){ printf("%s %s.\n","There was an error opening ", filename); return -1; } return 1; } textFileExists("text.txt"); return 0; } But when I compile this code, I get this warning. warning: passing argument 2 of ‘fopen’ makes pointer from integer without a cast FILE *fp= fopen(filename,'r'); Running this code