Hey the following code works in counting vowels consonants and spaces of a given file but how do i convert an uppercase letter to lower? This must be
a simple fix but how would i put this into my loop?
Thanks for the help!
Justin
// Include Section
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <iomanip>
using namespace std;
// Main Program
int main( )
{
// Constant Declarations
// Variable Declations
char data; // Contents of the file.
int countvow = 0; // Counts the vowels
int countcon = 0; // Counts the consonants.
int space = 0; // Counts the spaces.
// Output Identification
system("CLS");
cout << "In Class/Take Home #x by John Smith - "
<< "Example Program\n\n";
ifstream in_stream;
in_stream.open("I:\\test.txt");
if (in_stream.fail())
{
cout << "Input file opening failed.\n";
}
////////////////////////////////////////////
// The following code reads in the data of the text file and determines if
// the character is a vowel, consonant, or space.
in_stream.get(data); // Retrieves the file contents.
while (! in_stream.eof())
{
//if(isupper(data))
// tolower(data);