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?
hoke
0
Newbie Poster
Recommended Answers
Jump to PostNo 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
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
dkalita
110
Posting Pro in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.