You are here:

C/converting file formats

Advertisement


Question
How to convert binary file format to ASCII format?

Answer
I don't think this is possible.
ASCII is a set of 128 symbols.
And this makes use of only 7 bits in a byte.
So, always the 8th bit (1st from the left) is 0 in an ASCII symbol.

But, binary symbol takes all the 8 bits into consideration.

So, how can you convert 8 bits to 7 bits.
If you really want to do that, then you will be losing lot of information. 12.5% to be exact!
You can mask of the left most bit with 0 and whatever that is left will be ASCII.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.