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 intestGuards.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