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 ???

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.