Hey there im having a problem trying to compile my code, i get :
Code:
C:\money.cpp variable `std::stringstream ss' has initializer but incomplete type
Im not totally sure why, i've tried googling about but am still stumped by this, code:
money.h:
Code:
#ifndef MONEY_H
#define MONEY_H
using namespace std;
class parse{
private:
string input;
public:
parse();
~parse();
double parseIn(string& unparse);
};
#endif
money.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;
}
main.cpp:
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;
}