News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Character/String contains a letter/number

Started by wonopon, February 19, 2011, 09:57:14 PM

Previous topic - Next topic

wonopon

Is there something that can check if a string or character variable contains a letter?
For example :


char x;
cout << "Type a word : ";
cin >> x;
if ( ) { // if x has the letter a in it then : //
cout << "Your word contains the letter a in it!" << endl;
}


Jenna

Not related to C::B in any way and therefore violating our forum rules.

Topic locked !