c++ - Why does cin cause this program to hang? -


i have posted relevant code below. when compile program, runs , reaches point waits input. type in integer , press enter, code never continues. how go correcting this?

int i; cout << "please input column sort by: "; cin >> i; 

well, first of all, posted above won't compile. try instead:

#include <iostream>  int main(int argc, char *argv[]) {     int i;      std::cout << "please input column sort by: ";     std::cin >> i;     std::cout << "you entered: " << << "\n";      return 0; } 

compile g++ -o3 thefile.cpp, assuming file called "thefile.cpp".

if doesn't work there serious issue going on. if should able diagnose issue further.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -