dimanche 24 avril 2016

Condition outside {0,1,2,3,4,5,6,7,8,9} in C

For a project I am currently checking a string using an index. I know that I can use that kind of condition:

if (index >= '0' && index <= '9')

But how can I do to put a condition saying "If my index IS NOT included between 0 and 9, do this" ? Like, if at any time str[index] != 0 or 1 or ... or 9, I exit.

How can I do that condition in C please?

Aucun commentaire:

Enregistrer un commentaire