Can any one help me with these codes: i m freaking out here
I split my program in 3 parts.
1. main - prac.cpp
2. interface - base.h
3. implementation - base.cpp
in prac.cpp the code is:
#include <iostream>
using namespace std;
#include "base.h"
int main(){
Base ob;
ob.set();
ob.get();
system("pause");
return 0;
}
in base.h the code is:
#ifndef BASE_H
#define BASE_H
#include <string>
class Base{
string word;
public:
void get();
void set();
};
#endif
and in base.cpp the code is:
#include "base.h"
void base::set(){
cin >> word;
}
void base::get(){
cout << word << endl;
}
i got this error: "Error 1 error C2146: syntax error : missing ';' before identifier 'word' in "base.h" " in visual 2008
any help is highly appreciated...... thanks in advance