I am trying to print out the number of occurences for each alphabetic chracter in a file that our instructor provided us with. The values range from 1 to 999. I'm trying to print out "count[...] : " followed by the character. So far my counts are correct. However, at the end of each & every line, the program 'spits' out the digit '4.' Is the problem being caused by the arguments in my printf function? Thanks!
// The values of possible count[c] range from 1 through 999 // Print array of the 26 letters in the alphabet & their counts for (c = 0 ; c < 26 ; c++) cout << "count['" << (char)('a' + c) << "'] : " << printf(" %3u", count[c]); cout << endl;