std::streampos size;
char * memblock;
std::ifstream input ("A.JPG", std::ios::in|std::ios::binary|std::ios::ate);
if (input.is_open())
{
size = input.tellg();
memblock = new char [size];
input.seekg (0, std::ios::beg);
input.read (memblock, size);
input.close();
std::cout << "[INPUT]the entire file content is in memory " << sizeof(memblock) << " \n";
}
delete[] memblock;
I would like to use the ifstream to read A.JPG (28KB) and save it into the array memblock. But why do the size of the memblock is 4 instead of 28403 while the variable size is equal to 28403?
Thank you.