what if I wanted the user to enter his birth month and I don't know whether the user input is integer or string
for example july or 7
what should I do ???

Recommended Answers

There are functions that will check this for you: isalpha, isdigit both from #include <cctype>

From there you can either read a string or convert to number (via strtol).

Jump to Post

All 2 Replies

There are functions that will check this for you: isalpha, isdigit both from #include <cctype>

From there you can either read a string or convert to number (via strtol).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.