I'm trying to learn C++ on my own so I figured I'd try to write a program for my data communications class. We were learning about hamming codes and I want to try to make a program that will let me do it automatically instead of on paper. I'd take 8-bit binary numbers from a text file and add 4 parity bits for even parity..
I want to take these 3 numbers:Originally Posted by for those who don't know about hamming codes
and output them as these:
I was thinking of using infile.get() to get each number as a char through a loop(or multiple) and then finding out whether to make an even or odd parity. I'm kinda lost though.
If anyone has a link to similar code to this that I could look through as an example, that would be helpful as well.