These are some things I noticed in programs that I want to comment on so you can tell what I am looking for in grading programs. Some of these are style issues that are important, but there is no one right way to do them. I'll try to be specific in the notes.
Spread the program out of the page. Leave spaces around parts of statements. Leave space between sections of code. Think of paragraphs. Several lines of code that work together to solve part of the problem are a paragraph and should be set off from the rest of the code.
Put long comments above the line, putting them after hides the code when they wrap. Also, tell me what the statement is for, not what it does.
x++; // increment x is not helpful x++; // increment the vowel counter
I make my constants all capital letters so they stand out in the code. That makes them more noticeable.
Use globals sparingly, they make fixing a program harder since they can be changed anywhere. I make the first letter in a globals name a capital letter to make them stand out.
It is very important to initialize variables before you use them. But you don't need to set all the elements in an array to zero before you start putting string characters in it. Only the element after the last character needs to be zero. When initializing string constants, like
char * vowels = "aeiou";
If you declare a character pointer like this
char *cptr;
char *vowels="aeiou"; char *src=vowels; while(*cptr++ = *src++) ;
cptr = new [strlen(vowels) + 1];
If you have a pointer to the beginning of an array and one to the end, it isn't safe to calculate the length by subtracting the first pointer from the second. Some systems use memory in the other direction and this will give you a negative number.
When using strings, you can check if you are at the end by just checking the value.
if(string[i])
if(string[i] != '\0')