getter and setter

#include <iostream>

using namespace std;
class fool
string name;
string getname(){return name;}
void setname(string n){name=n;}
int main()
fool person1;
please find the error is probably in the main function
So what name do you want person1 to have?
1) Please use code tags when posting code, to make it readable:

2) In main, you're trying to use a variable called m, but you haven't defined that variable anywhere. You should read the error messages that your compiler is giving you, because I'm sure it's already told you that.
Topic archived. No new replies allowed.