#pragma Directive

This page was translated by a robot.

The #pragmadirective is used to control the compiler. However, since each compiler can specify its own control commands, no general scheme can be given, so the use of the #pragmadirective is ADVISED for the general programmer.

However, the most well-known representative of the #pragmadirective is the once command, which tells the compiler to include a file at most once for a #includedirective . However, whether this once command is specified in every compiler is uncertain, so it is discouraged.

// File: test.h
#pragma once
class test{};

no error
#include "test.h"
#include "test.h"

A method that works on all C compilers can be found on the page about including files once .