Can someone explain the following behavior to a relative newbie ...
const char cInputFilenameAndPath[] = "W:\\testerfile.bin";
int filesize = 4584;
char * fileinrampointer;
fileinrampointer = (char*) malloc(filesize);
ifstream fsInputFileStream;
fsInputFileStream.open(cInputFilenameAndPath, fstream::in | fstream::binary);
fsInputFileStream.read((char *)(fileinrampointer), filesize);
for(int f=0; f<4; f++)
{
printf("%x\n", *fileinrampointer);
fileinrampointer++;
}
I was expecting the above code to write the first 4 bytes of the file I just read in memory. In a loop, I just show the current byte that the pointer points to, then increment the pointer, ready to display the next byte. When I run the code, I get:
37
ffffff94
42
ffffffd2
, , , 64- .
, 'char , char, .
* fileinrampointer unsigned __int8, , ( 1s), , , - , ?