In this code i would like to store the values that are being outputted.
fstream filestr;
char check[4];
filestr.open("D:\\bio.pdf", fstream::in | fstream::binary);
if(filestr.is_open())
{
int i;
char check[4]={0};
for(i=0;i<4;i++)
{
filestr.read(&magic[i],1);
cout<<hex<<static_cast<int>(check[i])<<endl; //<-- This LINE
}
}
The numbers that are printed here i would like to save them for later use. Can someone help me how to get this tast done.