Hi my problem is as follows. I want to stream a certain amount of bytes from usbimage2.txt until my buffer is full then write them to new.txt.
My first problem is my buffer. If i give the buffer a value of say '4' it compiles with no errors. However i want to give it the size of the int 'Size_of_the_file' which i declared earlier in my file but it was just a straight forward int. When i do this i get the error
Constant expression required in function main.
Secondly when i do assign the buffer a test value of say '4' it just does nothing.
Can anyone see what im doing wrong?
thanks
char buffer[Size_of_the_file];
ifstream myFile ("C:\\bollock\\usbimage2.txt", ios::in | ios::binary);
myFile.seekg (start_byte,std::ios::beg) ;
myFile.read (buffer, 100);
fstream myFile2 ("new.txt", ios::out | ios::binary);
myFile2.write (buffer, 100);