Salutations
je débute dans le développement avec c++, j'ai un petit problème avec la suppression de caractères spéciaux d'un fichier texte ou du string extrait de ce dernier
quelqu'un pourrai-t-il m'aider
voici mon code source
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 #include <string> #include <fstream> #include <iostream> #include <algorithm> int main() { std::ifstream fichier("fichier.txt"); std::ofstream resultat("resultat.txt"); if (fichier.good()) { while(fichier.good()) { std::string tmp; fichier>>tmp; if (!fichier.fail()) resultat << tmp << "\n"; } fichier.close(); } return 0; }
Partager