fichier3 << "\nLe nombre de ligne(s) total est de : " << nbrligneTot << "\nLe nombre de page(s) est de : " << nbrpage << "\nLe nombre de mot(s) est de : " << trouve << "\nLE nombre de mot total est de : " << nbrmottot;
fichier3.close();
}
else { cout << "\nLe fichier n'a pas pu s'ouvrir correctement"; }
What happened to the code tags in your fitst post?
In what directory is your input file? I needs to be in the same directory as the ".cpp" file for "main".
In the line ifstream fichier("docum.txt", ios::in | ios::app); the , ios::in | ios::app is not needed as the "i" says it is already an input file and there is nothing to append to the file because you can not not write to it.
It is also possible that the file will not open because of the , ios::in | ios::app
You have written initialize nbrmottot on the begining of code.After that you have given it a value 1 but you have done that in {} blocks and when it get out of the blocks i believe it gets destroyed.It's better for you to initialize it on the begining like nbrmottot.This is your: error Run-Time Check Failure #3 - The variable 'nbrmottot' is being used without being initialized.
Enter nbrmottot=1; on the begining of your code.
As I suspected the , ios::in | ios::app was the problem. When I first ran the program it created the file "clef.txt" which was an empty file so the while failed to read anything.
Not having anything for input files I could not test the program any farther.
I do agree with Zivojin that you have two uninitialized variables. With VS2017 all it takes to initialize a variable is an empty set of {}s or you can put a number inside them if you need something else.
I will see what I can do for the input files and if I find anything else in your code.