-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathescales.cpp
More file actions
52 lines (48 loc) · 780 Bytes
/
escales.cpp
File metadata and controls
52 lines (48 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*Turikumwe Fabrice E.
Allan Tarcy*/
#include "escales.hpp"
using namespace std;
vector<Escales *> Escales::toutEscales;
vector<Escales *>::iterator it;
Escales::Escales(int i, string n, int p)
{
id = i;
nom = n;
prix = p;
toutEscales.push_back(this);
}
Escales::~Escales()
{
//toutEscales.clear();
for (size_t i = 0; i < toutEscales.size(); i++)
{
delete toutEscales[i];
}
}
int Escales::getId()
{
return id;
}
string Escales::getNom()
{
return nom;
}
void Escales::setPrix(int p)
{
id = p;
}
void Escales::setNom(string n)
{
nom = n;
}
void Escales::Affiche()
{
for (it = toutEscales.begin(); it != toutEscales.end(); it++)
{
cout << (*it)->getNom();
}
}
int Escales::getPrix()
{
return prix;
}