Author Topic: Character/String contains a letter/number  (Read 3371 times)

Offline wonopon

  • Single posting newcomer
  • *
  • Posts: 4
Character/String contains a letter/number
« 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;
}

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Character/String contains a letter/number
« Reply #1 on: February 19, 2011, 10:17:42 pm »
Not related to C::B in any way and therefore violating our forum rules.

Topic locked !