Using \x I can specify hexadecimal numbers in strings in C, but if I put \x00 then it interprets it as an instruction to terminate the string. As a result I can't express a hexadecimal number with 00 in it using a string! Is there some way around this?
Jump to Post
No way around it if you want to use normal string handling functions found in string.h and stdio.h. You will have to treat the character array as containing binary data.
Well, I suppose you could create the string to contain normal decimal values such as
char num = "01";…
All 3 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.