I am trying to use header file sstream.h Below is my code segment
#include <iostream>
#include <string>
#include <sstream>
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;
}
But i am getting following error
unable to open include file sstream.h
Does anyone have a clue what I am doing wrong?
There are a lot of issues, try the following:
Some:
getcharinstead ofgetch<cstdio>forgetcharstringandstringstreamwithstd::sstream, notsstream.h