1 pièce(s) jointe(s)
Suppression des caractères spéciaux d'un fichier ou string
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
Code:
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;
} |
Merci