Files
CoursCPP/TP7/Pays.cpp
2024-11-26 20:38:50 +01:00

25 lines
424 B
C++

#include "Pays.h"
#include <iostream>
using namespace std;
void Pays::saisie(ifstream &in) {
getline(in, Region, ';');
getline(in, Nom, ';');
getfloat(in, Population, ';');
// Pas dans le fichier :(
// getfloat(in, Area, ';');
// "trim" en c++
auto end = Nom.end();
while (*(end-1) == ' ')
end--;
Nom.erase(end, Nom.end());
}
void Pays::affichage() {
cout << Region << " " << Nom << " " << Population;
}