TurkeyMaster77
11-02-2008, 07:47 PM
I keep getting errors when I begin to include strings in my custom classes!! Actual program is more complex, but here's where I'm hitting problem.
It's throwing all kind of exceptions concerning 'string' identifiers, missing type specifiers and missing ';'s. Thanks
Driver.cpp:
#include <iostream>
#include <string>
#include "Custom.h"
using namespace std;
int main () {
Custom testClass ("test");
return 1;
}
Custom.h:
class Custom {
public:
Custom (string p_title);
private:
string title;
}
Custom.cpp:
#include <iostream>
#include <string>
#include "Custom.h"
using namespace std;
Custom::Custom (string p_title) {
title = p_title;
}
It's throwing all kind of exceptions concerning 'string' identifiers, missing type specifiers and missing ';'s. Thanks
Driver.cpp:
#include <iostream>
#include <string>
#include "Custom.h"
using namespace std;
int main () {
Custom testClass ("test");
return 1;
}
Custom.h:
class Custom {
public:
Custom (string p_title);
private:
string title;
}
Custom.cpp:
#include <iostream>
#include <string>
#include "Custom.h"
using namespace std;
Custom::Custom (string p_title) {
title = p_title;
}