Sunday, August 2, 2009

Wats wrong with this?

i'm using dev-c++ as my compiler and every time i try and compile this it tells me theirs no such file or directory 4 the header #include %26lt;sstream%26gt;.





// stringstreams


#include %26lt;iostream%26gt;


#include %26lt;string%26gt;


#include %26lt;sstream%26gt;


using namespace std;


int main()


{


string mystr;


float price=0;


int quantity=0;





cout%26lt;%26lt; "enter price: ";


getline (cin,mystr);


stringstream(mystr) %26gt;%26gt;price;


cout%26lt;%26lt;"enter quantity: ";


getline (cin,mystr);


stringstream(mystr) %26gt;%26gt; quantity;


cout%26lt;%26lt;"total price: "%26lt;%26lt;price*quantity%26lt;%26lt;end1;


system("PAUSE");


return 0;


}





wats wrong with it?

Wats wrong with this?
You don't have the sstream library in your header libraries folder. You need to obtain a copy of it and put it in with the rest of your header files.
Reply:idk cause i have no clue what it is
Reply:In my brain it makes absolutely no sense at all. sorry.
Reply:try downloading a copy of "sstream.h" maybe your version got messed up?
Reply:Make sure you have the newest version fo Dev-C++


Older versions of Dev-C++ do not have sstream
Reply:two many of these....%26lt;


No comments:

Post a Comment