Question: I want to check a header in my source file and if its already defined, I want to undefine it.

Is it possible?

Answer: 
`#undef` is the opposite of `#define` and actually cancels it.

It's very useful when you need a macro for some task but does not wish to "pollute" the symbol tables

```
// referencing FOO is an error (not yet defined)

#define FOO(arg_) ....

FOO(A)
FOO(B)
FOO(C)

#undef FOO

// referencing FOO now is an error (not defined)

```

There is no way to cancel a `#include` directive.
You could stop the header being included - the simplest way would be to remove or comment out the `#include` directive.

You could also pre-define your guards so that the include is inneffective.

```
foo.h
#ifndef __FOO_H
#define __FOO_H

/* contents of foo.h */

#endif /* __FOO_H */

foo.cpp
#define __FOO_H
#include "foo.h"
/* contents of foo.cpp */

```

Using this strategy you could use the preprocessor to select whether to pre-define the guards, or even have inner guards within you header. 

If you really need only to have part of the file included, it would be better to split the file into two.