Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - the "once" pragma can be used to indicate that the file which contains this http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The "once" pragma can be used to indicate that the file which contains this
pragma should only be opened and processed "once".  The following describes
the form of the "once" pragma.

+--------------------------------------------------------------------------+
|      #pragma once [;]                                                    |
|                                                                          |
+--------------------------------------------------------------------------+
Assume that the file "foo.h" contains the following text.

Example:

     #ifndef _FOO_H_INCLUDED
     #define _FOO_H_INCLUDED
     #pragma once
         .
         .
         .
     #endif

The first time that the compiler processes "foo.h" and encounters the "once"
pragma, it records the file's name.  Subsequently, whenever the compiler
encounters a #include statement that refers to "foo.h", it will not open the
include file again.  This can help speed up processing of #include files and
reduce the time required to compile an application.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson