I'm learning C++ code in my engineering class, but my professor doesn't help, or explain. He just gives homework. Here is my assignment (it is split into 4 parts):

1.) Write a program that reads a data file and determines the number of occurrences of each of the characters in the file; then, print the characters and the number of times that they occurred; if a character does not occur, do not print it (hint: use an array to store the occurrences of the characters based on their ASCII codes)


The problem with the first one is that I don't know how to get the program to only print the characters that occur in the data file, mine prints all of the letters in the alphabet.


So, ill post this now while i work on posting the other 3 parts.