HowlandCh8Ex4 - if(check) { str = str.substr(0,letter)+...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <string> # using namespace std; u string remove(string& str); bool isVowel(char); b int main() { //10 string str; string str1; cout << "\n\n Please Enter A String " << endl; getline(cin, str); str1 = remove(str); cout << str1 << endl; system("pause"); s } //end main //20 { int letter=0; int temporary; bool check; int len = str.length(); while(letter < len) { check = isVowel(str[letter]);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if(check) { str = str.substr(0,letter)+ str.substr(letter+1, len); len = str.length(); l } letter++; l } return str; } //end of string substr / bool isVowel (char x) { if ((x=='a')||(x=='e')||(x=='i')||(x=='o')||(x=='u')||(x=='A')||(x=='E')|| (x=='I')||(x=='O')||(x=='U')) { return true; } else { return false; } }//end isvowel function }...
View Full Document

This note was uploaded on 11/16/2010 for the course CSIS 115 taught by Professor Enkelmann during the Fall '06 term at Metropolitan Community College.

Ask a homework question - tutors are online