C++
Include guards

by oldmud0

#pragma once

#ifndef _FILE_FOOBAR
#define _FILE_FOOBAR

// ...

#endif

I like the #pragma once directive because it will ensure that the file is included only once. Too bad that it is a non-standard directive.

Benny Neugebauer

Personal preference:

pragma once

ifndef _FILE_FOOBAR

define _FILE_FOOBAR

// ...

endif

Carl Hjerpe

Sign in to comment!