Let's start little by little.
For your first three functions:
IsPeriod function:
1 2 3 4 5 6 7
|
bool IsPeriod(char letter)
{
if (letter == '.')
return true;
else
return false;
}
|
Switches are only ever useful when you have many statements, surely not one.
IsComma function:
1 2 3 4 5 6 7
|
bool IsComma(char letter)
{
if (letter == ',')
return true;
else
return false;
}
|
IsVowel function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
bool IsVowel(char letter)
{
letter = toupper(letter);
switch (letter)
{
case 'A':
return true;
break;
case 'E':
return true;
break;
case 'I':
return true;
break;
case 'O':
return true;
break;
case 'U':
return true;
break;
default:
return false;
};
}
|
Here a switch is ok, also check how to use switches, you need break statements for each cases
For the rest of your code, I have a few questions / comments:
_Why do you want to use cstrings instead of strings?
_Instead of reading the whole file and cutting it down, which looks like a pain, why don't you just read a line, then deal with that line and only after, read the second line and repeat?
_What exactly is your pigLatin function supposed to do?
_What are you trying to do with the punctuation?