I have these files that were given to me to solve and I have some doubts about header guard.
- In - testGuards.h, there is a define like- __HEADER_GUILD_SAFEBOX__, but the- #ifdefasks if- __GUILD_SAFEBOX__is defined, so I don't know if this- #ifdefshould ask about- __HEADER_GUILD_SAFEBOX__instead of- __GUILD_SAFEBOX__.
- In - testCpp.hI ask if- __GUILD_SAFEBOX__is already defined, but, as far I know, it is already defined in- testGuards.h, but here (in cpp), we never enter into the- #ifdef, and I not know, how to know if is not defined, and if not defined, then define it.
I have 2 codes.
testGuards.h
#ifndef __HEADER_GUILD_SAFEBOX__
#define __HEADER_GUILD_SAFEBOX__
#include "stdafx.h"
#ifdef __GUILD_SAFEBOX__
[...]
#endif
testCpp.cpp
#include "stdafx.h"
#ifdef __GUILD_SAFEBOX__
#include "../common/tables.h"
[...]
#endif
 
     
     
    