Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: wonopon on February 19, 2011, 09:57:14 pm

Title: Character/String contains a letter/number
Post by: wonopon on February 19, 2011, 09:57:14 pm
Is there something that can check if a string or character variable contains a letter?
For example :

Code
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;
}
Title: Re: Character/String contains a letter/number
Post by: Jenna on February 19, 2011, 10:17:42 pm
Not related to C::B in any way and therefore violating our forum rules.

Topic locked !