-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (37 loc) · 768 Bytes
/
main.cpp
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
#include <iostream>
#include <fstream>
#include <cstdlib> // Permet de vider le Terminal
#include <string> // Pour lecture de fichiers
using namespace std;
void clearTerminal(void)
{
system("clear"); // if (system("CLS")) ???
}
bool isEmpty(ifstream& pFile)
{
return pFile.peek() == ifstream::traits_type::eof();
}
void checkInfo(void)
{
string line;
ifstream file ("info.txt");
if (file.is_open())
{
cout << "pas vide";
file.close();
}
else // Première partie où fichier effacé
{
cout << "Fichier de sauvegarde introuvable :(\nDébut d'une nouvelle aventure !";
ofstream info_file;
info_file.open ("info.txt");
info_file << "0";
info_file.close();
}
}
int checkInfo(void)
{
start();
cout << endl; // au cas ou :)
return 0;
}