[3 / 1 / 2]
58KiB, 976x850, _91408619_55df76d5-2245-41c1-8031-07a4da3f313f.jpg
Quoted By: >>1269341
How do I take an integer and check if the input is actually an integer? It's hard to describe, but here's example
int x;
cin>>x;
(user inputs abc)
cout<<x;
0
(rest of code)
cout will tell me that x==0 and it will proceed to break the rest of my code, but
(user inputs 0)
cout<<x;
0
cout will tell me that x==0 but the rest of my code will work as intended,
How do I check if x==0 and isn't just a string roleplaying as 0? I need the user to be able to input 0, but return if x isn't an integer
int x;
cin>>x;
(user inputs abc)
cout<<x;
0
(rest of code)
cout will tell me that x==0 and it will proceed to break the rest of my code, but
(user inputs 0)
cout<<x;
0
cout will tell me that x==0 but the rest of my code will work as intended,
How do I check if x==0 and isn't just a string roleplaying as 0? I need the user to be able to input 0, but return if x isn't an integer