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.
Do you mean you want to **ensure that the header file is included once and only once?** The standard solution to this is using an *include guard*.

I.e. surround the contents of your header with

```
#ifndef MY_HEADER // a unique identifier for each header
#define MY_HEADER

...

#endif

```

This is guaranteed to work in all platforms. Some compilers also provide a `#pragma` to achieve the same effect with less hassle, e.g. in Visual C++ you can add

```
#pragma once

```

at the start of your header file.