oh yea, this is the error i get... sorry, i forgot to post it...
Code:
[montez@localhost montez]$ c++ class.cpp -o class -O2 -Wall
class.cpp: In function `int main()':
class.cpp:5: error: too many arguments to function `void results()'
class.cpp:40: error: at this point in file
EDIT:
oh yea, and thats after i changed the code to this:
Code:
#include <iostream>
using namespace std;
void results();
class Person {
public:
Person();
~Person();
string name;
int age;
string hobby;
int siblings;
};
Person::Person() {
cout<<"Constructor started... "<<endl;
}
Person::~Person() {
cout<<"YOU KILLED IT!!! "<<endl;
}
int main() {
Person Perso;
cout<<"Whats your name? ";
cin>>Perso.name;
cin.get();
cout<<"How old are you? ";
cin>>Perso.age;
cin.get();
cout<<"Whats your hobby? ";
cin>>Perso.hobby;
cin.get();
cout<<"How many siblings do you have? ";
cin>>Perso.siblings;
cin.get();
results(Perso);
}
void results(Person &P) {
cout<<"Your name is: "<<P.name<<". "<<endl;
cout<<"You are "<<P.age<<" years old. "<<endl;
cout<<"Your hobby is "<<P.hobby<<". "<<endl;
cout<<"You have "<<P.siblings<<" siblings. "<<endl;
}