Hey guys , i am facing a problem using fprintf. Basically what happens is that , i will use it to read from an array and store the information in a txt file.

The problem i face is that , for some reason , numbers such as "02 , 05" , will just appear as 2 and 5.

From reading up , it say it has something to do with the precision . Does anybody know how i can go about fixing this error.

my format of the fprintf string is ( "fpintf(ptFILE , "%x", out) , as i am reading hexadecimal numbers

Recommended Answers

All 2 Replies

I think using "%02x" will do the trick.

thanks alot!

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.