Author Topic: Character/String contains a letter/number  (Read 1926 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: [Select]
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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
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 !