Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intermediate values in C++

Tags:

c++

I can not find how to implement a design in C++. In the language of Delphi in case the operator can write the following design:

    case s[j] of
         '0'..'9','A'..'Z','a'..'z','_': doSomeThing();

How can i do the same in c++. Attracts me is the construction type 'a' .. 'z' and etc...

Thank you

like image 626
0xAX Avatar asked Aug 29 '26 08:08

0xAX


1 Answers

You can do it using isalnum function as:

if(isalnum(s[j]) || (s[j] == '_') )
like image 93
codaddict Avatar answered Aug 30 '26 23:08

codaddict