Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Without using binary writer need to generate a binary string with weird character based on some hex data "30303054313032202020303030" in VC++

Input Hex:5430323120302030302030

Output :6      
Posted
Updated 23-Apr-13 20:15pm
v3
Comments
[no name] 23-Apr-13 8:18am    
This is not a question or a description of a problem. I am not even sure that it's a coherent sentence. What exactly is it that you think a "binary string with weird character" is?

1 solution

Such a string does not represent 'weird characters', in my opinion (it represents the following character sequence "000T102 000").
You have to:
  • convert the string into an array of unsigned chars (each ordered pair of characters of your string represent an unsigned char)
  • write the unsigned char array to a binary file (using, for instance fwrite function (or ofstream::write method).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900