All pastes #346257 Raw Edit

Mine

public cpp v1 · immutable
·published 2007-02-09 05:55 UTC
rendered paste body
#include <iostream>#include <string>class Person{private:	std::string name;	int age;public:	Person(std::string &name, int &age)		: name(name), age(age)	{	}	void setName(std::string &fullName)	{		name = fullName;	}	std::string getName() const	{		return name;	}	void setAge(int &realAge)	{		age = realAge;	}	int getAge() const	{		return age;	}};int main(){	std::string name;	int age;	std::cout << "Enter your first name: ";	std::getline(std::cin, name);	std::cout << "Enter your age: ";	std::cin >> age;	Person *person = new Person(name, age);	std::cout << "Your name is: " << person->getName() << std::endl;	std::cout << "Your age is: " << person->getAge() << std::endl;	delete person;	return(0);}