Does not show the result on screen


I am totally new to C++ so bare with me. I was reading some of the threads here and saw this code regarding Date. See below code sample

// stringstreams
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main ()
string mystr;
float price=0;
int quantity=0;

cout << "Enter price: ";
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Enter quantity: ";
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Total price: " << price*quantity << endl;
return 0;

After compiling and running using the Dev-C++, I do not see the result on screen. What should I do in order for me to see the result.

Thank you,

Did you provide the input it asks for?
It works. I'm using Qt in mac.
I don't see anything related to the date. did you post the wrong code ?
Make sure that you are clicking on compile and run not just compile all. I know that a lot of people get lost with this one in Dev-C++.
Topic archived. No new replies allowed.