Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to make this code read a tex

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to make this code read a text file from a disk please help and I want to make it count the duplicate words in a file>thanks


#include <iostream.h>
#include <apstring.h>
#include <ctype.h>

void main(void)
{
apstring str;
apstring vowels = &quot;AEIOU&quot;;
int count = 0;

cout << &quot;Enter a Line of Text &quot;;
getline(cin,str);

for( int i=0; i< str.length(); i++)
if( vowels.find( toupper(str) ) != -1 ) // -1 means &quot;not found&quot;
count++;

cout << &quot;Number of Vowels Is &quot; << count;

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top