How do i check if the input is an integer or a string in c++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How do i check if the input is an integer or a string in c++?

Check if it is integer or string

9th Feb 2017, 8:22 PM
Erinda Kapllani
Erinda Kapllani - avatar
1 Answer
+ 6
you define a variable as a string you must include string and then use strtol to find out if there is a number in the string
9th Feb 2017, 8:58 PM
Georgios Markou
Georgios Markou - avatar