This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying to open and read a binary file.
I am using the following code:
FILE* BinFile;
BinFile = fopen("output123.bin", "rb");
if(BinFile)
{
Display_printf(displayHandle, 0, 0, "File exists... = %x \n", BinFile);
}
if (BinFile == NULL)
{
Display_printf(displayHandle, 0, 0, "Error opening file...\n");
perror("fopen");
return (NULL);
}
Now the problem is that the file "output123.bin" does not exist anywhere, but I get no error message instead the output is :
File exists... = 20002120
When I try to read a file that actually exists in the same directory, what I read is completely wrong.
Despite the title of the article, please let me know of one of the Tips for using printf is helpful.
Thanks and regards,
-George