I have this code where I have the user input their zip code and I convert it to a bar code. It all works fine until I want it to output the bar code properly.
also I did have some help from someone and they told me to do ch[i] - '0' but I didn't know the purpose of that. Can someone explain that to me please?
ch[i] - '0' is a cheap hack for "converting" char's of digits into numbers.
For example, '2' will be converted to 2, and '9' will be converted to 9 and so on. They must be converted because, for example, '2' is a character with an ASCII code of 50 (0x32 hexadecimal) which is obviously not the same as 2.