hello
in my program, i want to be able to read, and write the binary values. i want to be able to read: (as text) "hi", and getr (in hex) "68 69",
then i want to be able to write (as hex) "FF FF" and stuff.
in short i want to need to use a hex editor to view my values,
here is what i got so far
Code:
unsigned encrypt2bytes(unsigned key){
ifstream qaz("data.txt",ios::in | ios::binary ); // this file is just opened to
if (! qaz){ cout << "error, check file existance";} // to let us read it
unsigned tev; qaz>> tev;
ofstream qaze("endata.txt", ios::binary | ios::out); //this is the one that actually is going to write to the new file
if (! qaze){ cout << "error, check file existance";}
qaze << encrypt(key, tev);
qaz.close();
qaze.close();
return 0;
}
unsigned decrypt2bytes(unsigned key){
ifstream qaz("endata.txt", ios::in | ios::binary); // this file is just opened to
if (! qaz){ cout << "error, check file existance";} // to let us read it
unsigned tev; qaz >> tev;
ofstream qaze("data.txt", ios::binary | ios::out); //this is the one that actually is going to write to the new file
if (! qaze){ cout << "error, check file existance";}
qaze << decrypt(key, tev);
qaz.close();
qaze.close();
return 0;
}
thanks