#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include "Personne2.h"

using namespace std;


Personne2::Personne2()
{
	nom = new char[20];
	strcpy(nom, "toto");

	prenom = new char[20];
	strcpy(prenom, "totop");

	age = 20;
}

Personne2::Personne2(char* nom, char* prenom, int age)
{
	this->nom = new char[20];
	strcpy(this->nom,nom);

	this->prenom = new char[20];
	strcpy(this->prenom, prenom);

	this->age = age;
}

Personne2::Personne2(Personne2 const & autre)
{
	this->nom = new char[20];
	strcpy(this->nom, autre.nom);

	this->prenom = new char[20];
	strcpy(this->prenom, autre.prenom);
	
	this->age = autre.age;
}

void Personne2::afficher() const
{
	cout << nom << " " << prenom << " : " << age << endl;
}

Personne2::~Personne2()
{
	delete[] nom;
	delete[] prenom;
}