jeudi 2 novembre 2017

How to check for postive and negative integers in c++?

I am taking input from stringstream and trying to check if the input is +/- integer? I tried using regex but the system I am testing on, does not support it. I have also tried to use isdigit with no success.

This should not be as hard as I am making it. Please help. I am using c++11.

Sample Input:

11
-12
*(
1

Aucun commentaire:

Enregistrer un commentaire