Why I can't debug this code and how to resolve "undeclared identifiers" mistakes in .h FileTools class file. Task and code below | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Why I can't debug this code and how to resolve "undeclared identifiers" mistakes in .h FileTools class file. Task and code below

I need it to be solved with C++. The task itself is below. Even though it seems that I wrote a right code, since there are no highlighted errors, I cannot debug since there are like 50 errors. Almost all of them in the .h file and about undeclared identifiers. Write a program to analyze a file and display various statistics about it. The analysis should be performed by a class called FileTools, which accepts the file name of a file to analyze via its constructor, and has the following member functions: - process() – reads the file and contains statistics about the number of lines, total number of character https://code.sololearn.com/carstqIRhyn0/?ref=app https://code.sololearn.com/c0q9mZ6gqxbp/?ref=app

26th Nov 2022, 5:11 PM
Alexandr Ignatov
Alexandr Ignatov - avatar
4 Antworten
0
I removed all invalid characters and edited the code. Now it works without any error on my part https://code.sololearn.com/cgWlrbqI0c18/?ref=app
26th Nov 2022, 9:06 PM
Ipang
+ 1
When I open the full driver code file I got some error messages pointing out that there are 'extended characters' in the code. Seems like your code gets some invisible & invalid characters that prevents the compiler from compiling the code. It happens mostly due to copy/paste of text/code from browser or other app which uses those characters for formatting etc. You can see the characters if you open the code in web, not SoloLearn app.
26th Nov 2022, 5:51 PM
Ipang
+ 1
Yep, it's working. Thank you
27th Nov 2022, 1:54 PM
Alexandr Ignatov
Alexandr Ignatov - avatar
0
I don't think that's the case because I just wrote the whole code again with copy/paste, and it is still not working. 46 out of 50 mistakes that are shown to me in VS connected to FileTools.h file, and the majority of those 46 mistakes are about undeclared identifiers. ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯
26th Nov 2022, 6:10 PM
Alexandr Ignatov
Alexandr Ignatov - avatar