FILE *fd;
if (fd=fopen(fileName,"r") == NULL)
{
printf("File failed to open");
exit(1);
}
This is a code snippet. When I compile it with gcc, i get the following warning:-
warning: assignment makes pointer from integer without a cast
When I put fd=fopen(argv[2],"r") within brackets, the problem gets solved..
I am not able to understand where am i converting integer to pointer when the brackets are not put.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…