hie
i am trying to read a picture(.jpg) file from my hard drive using Visual C++ 2008. i am trying to read it in binary format.
My code is as follows:
what i would like to ask is:
Is my code correct?
I don't know if i should use "r+b" instead.
i would also like to ask if there is a way to read that file in HEX format.
thanks in advance.
i am trying to read a picture(.jpg) file from my hard drive using Visual C++ 2008. i am trying to read it in binary format.
My code is as follows:
Code:
int readTranHeader2 (void* buffer,int size) { FILE * pFile; int pos = 0; pFile = fopen ( "\\ResidentFlash\\P100040.JPG" , "rb" ); fseek ( pFile ,pos , SEEK_SET ); fread (buffer , 1 , size , pFile ); fclose (pFile); return 0; }
what i would like to ask is:
Is my code correct?
I don't know if i should use "r+b" instead.
i would also like to ask if there is a way to read that file in HEX format.
thanks in advance.
Comment