Hey there im having a problem trying to compile my code, i get :
Im not totally sure why, i've tried googling about but am still stumped by this, code:Code:C:\money.cpp variable `std::stringstream ss' has initializer but incomplete type
money.h:
money.cpp:Code:#ifndef MONEY_H #define MONEY_H using namespace std; class parse{ private: string input; public: parse(); ~parse(); double parseIn(string& unparse); }; #endif
main.cpp:Code:#include <iostream> #include <string> #include "money.h" parse::parse(){ input = "0"; } parse::~parse(){ string *ptr; ptr = &input; delete ptr; } double parse::parseIn(string& inStr){ stringstream ss(inStr); double out; ss >> out; return out; }
Code:#include <iostream> #include <string> #include "money.h" int main() { string in; parse testParse; cout << "enter stuff: " << endl; cin >> in; testParse.parseIn(in); cout << "You entered: " << in << endl; testParse.~parse(); return 0; }



LinkBack URL
About LinkBacks


