Quick question regarding conditional compilation (ifndef)

This is probably a very stupid question, but I have to be sure. I am assigned a class declaration in the header file, for example.

#ifndef file_H
#define file_H

class ex{
private:

public:
};

#endif

and I needed to write the method definitions in the same file as me, my question is whether "#endif" remains, where it is right after the class declaration or does it go to the end of my file after the class method definition ?.

+5
source share
1 answer

At the end of the file.

#ifndef , , .

, C H, , , . , H. , , .

, , #endif.

+6

All Articles