Hello!
I would like to put the data in "char * memblock" into "char array[1024]".
Both are pointers so i dont understand why i cannot do that.
I tried to dereference them too but didnt work either.
Code:#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream::pos_type size; char * memblock; char array[1024] = {0}; ifstream file ("1.txt", ios::in|ios::binary|ios::ate); if (file.is_open()){ size = file.tellg(); memblock = new char [size]; file.seekg (0, ios::beg); file.read (memblock, size); file.close(); cout << "the complete file content is in memory \n" << memblock << endl; array << memblock; // ??? cout << array; delete[] memblock; } }



LinkBack URL
About LinkBacks




