A very beginners question!

I'm stuck in two exercises and need help.
The first one is to write a code which prints out the ASCII-tabel. I have no clue on this question.
The second one is to write a code which counts the characters used in a file. I can write a code which counts the number of characters in a row or in a text which is gotten from the terminal (e.x. via "getchar"). but I don't know how it would be with a file.