If your file was e.g. a bitmap image, I think you can use:
FILE* name = fopen("path/imagename.bmp", "rb");
and then reference 'name' where you need to.
So you could e.g. read the image header with:
fread(imageHeader, sizeof(unsigned char), 54, name);
(you would also have to define 'imageHeader' in the above example)
For reference, I found more info:
Code: Select all
[ fopen ]
#include <stdio.h>
FILE* fopen( const char *filename, const char *mode);
<filename> is a string containing a filename (see Pathnames).
If no file by that name exists, a new one is created.
<mode> is a string containing the read/write options.
Function opens a file and returns a FILE pointer to be used by other
I/O functions. It returns NULL if unsuccesful.
Note: Streams stdin, stdout, stderr, stdaux and stdprn are opened
automatically.
See also Standard I/O, freopen() and tmpfile.
from Thorsten Ottos site here:
https://tho-otto.de/hypview/hypview.cgi ... 8&index=37