problem with cin in QCoreApplication
-
wrote on 8 Jan 2018, 19:03 last edited by parvizwpf 1 Aug 2018, 19:04
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? -
-
wrote on 8 Jan 2018, 19:36 last edited by
it is excited. because run in terminal is active by default . but i recheck it and it will run in terminal and cin works good.
thanks -
it is excited. because run in terminal is active by default . but i recheck it and it will run in terminal and cin works good.
thanks@parvizwpf
Yep, seen that too. Its the power of Flip Flop ;)
1/4