I need help with the restrictions

the question is that I need help entering a figure that is a decimal and restricts

I come from brazil. My english is bad jejeje

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  	ErrorEntrada=true;
			while (ErrorEntrada==true)
		{
    
			ErrorEntrada=false;
			cout<<"\n Introduzca su sueldo: "<<endl;
			cin>>s;

			if( cin.fail() || s<=0||isdigit(s))  
			{
				cout << "Error de dato introducido" << endl;
				cin.clear();
				cin.ignore(10000,'\n');
				ErrorEntrada=true;}
		}
What type is s?

One thing that will help you asking questions here is to provide a complete, compilable (but minimal) code sample that reproduces the problem you are experiencing. Snippets in isolation such as this one are less helpful in diagnosing problems.
Last edited on
Topic archived. No new replies allowed.