problem with cin in QCoreApplication
Solved
General and Desktop
-
i use this code:
#include <string> #include <iostream> using namespace std; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); int oo=0; cout <<"enter : "; cin>> oo; cout << " item : "<<oo; return a.exec(); }
when i run it will execute in output window and write enter:
but when i type an integer and press enter it will repeat without end.
question 1: how can i run this program in console window?
question 2: why cin not work? -
Hi
Try to run app "in terminal"
in the Projects tab, under Run Settings, check the box marked "Run in Terminal".
-
@parvizwpf
Yep, seen that too. Its the power of Flip Flop ;)