You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to C++ GCU Forum
Hi everyone!
I want to know why in the second example of c++ course of the Getting Started I cannot get the sentence in the if conditional: if(!(cin>>input_var)){ cout<<"You entered a non-numeric. Exiting..."<<endl;
It doesn't work because I use windows and not linux? or because my IDE it's different. I use NetBeans.
Jai Bhardwaj
unread,
May 28, 2023, 12:49:49 AM5/28/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to C++ GCU Forum
Can I get the screenshot of the error that you are getting? In the if condition we are trying to get the input from the console and storing it in a variable( input_var ) it is most probably of integer type although you have not mentioned it. And if you'll enter any character or a string in the input this "if" block will execute.