Small problem in explaining a line

Hi people, I wish to ask how would you comment such line. What I was going to right was that it is defining a name for the text file. Which is the reason I have done it in the first place, but since I am still new to this language I wished to have a second opinion. Thanks in advance

#define Read "Filing.txt";

Regards
orangeapple
If you use that in an expression the semicolon will mess it up:
std::ifstream if (Read);
will translate to:
std::ifstream if ("Filing.txt";);
which is obviously wrong.

Your compiler should allow you to safely add comments to the end of #define statements unless you tell the preprocessor to include comments as part of the definition.
If you mean comment out, then just put a // at the beginning of the line...
Last edited on
Then was it by a matter of luck that it worked when I called read and it printed Hello Word which was what I had in the text file Filing.txt. It gave no errors in displaying the information and compiling.
or it is just the semi-colin?
Topic archived. No new replies allowed.