Getting no output...

Write your question here.

1
2
3
4
5
6
7
8
9
10
11
  #include <iostream>
using namespace std;

int main()
{
    double propval;

    cout << "What is the actual value of the property? \n";
    cin >> propval;

}


is there anything wrong with this code that im getting no output? when i remove the cin i get What is the actual value of the property?, but with this code i get a blank
What compiler are you using?
GNU GCC Compiler with codeblocks.. I'm going to try microsoft visual c++, as I feel it's something with codeblocks messing up, unless anyone can suggest something different
Hmm, I thought using std::cin would flush std::cout automatically but maybe that depends on the implementation.

Try manually flushing std::cout before using std::cin.
 
cout << "What is the actual value of the property?\n" << flush;

Or you can use the more commonly used std::endl that will both output a newline and flush.
 
cout << "What is the actual value of the property?" << endl;
Last edited on
Topic archived. No new replies allowed.