Hi I have have a sections of my program that extracts 4 bytes from a file one by one with the code below. I basically want the 4 bytes as a string of hexadecimal values so the only way I know how to do this is print each one off individually with the 'hex' attribute for cout.
However now I would prefer to have these for bytes as a 'string' of hex valjues as I would like to preform a search on these 4 bytes of hex. Can any advise me on how to transfore my 4 bytes into a string of their hex values?
any help will be much appreciated
Code:unsigned char VS1,VS2,VS3,VS4; infile.read (&VS1,sizeof (VS1)) ; infile.read (&VS2,sizeof (VS2)) ; infile.read (&VS3,sizeof (VS3)) ; infile.read (&VS4,sizeof (VS4)) ; file_op << std::hex << (int)VS1; file_op << std::hex << (int)VS2; file_op << std::hex << (int)VS3; file_op << std::hex << (int)VS4;



LinkBack URL
About LinkBacks


