Site Tools


c-pragma-once

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c-pragma-once [August 22, 2026 at 15:22] – created - external edit 127.0.0.1c-pragma-once [August 22, 2026 at 17:24] (current) Ivan Janevski
Line 1: Line 1:
 # C pragma once # C pragma once
  
-**[#pragma once](https://en.wikipedia.org/wiki/Pragma_once)** is a non-standard preprocessor directive that prevents multiple inclusion of a header file. It's simpler than [[header-guard|header guards]] and achieves the same goal, though it's not officially part of the C standard.+**[#pragma once](https://en.wikipedia.org/wiki/Pragma_once)** is a non-standard preprocessor directive that prevents multiple inclusion of a header file. It's simpler than [[c-header-guard|header guards]] and achieves the same goal, though it's not officially part of the C standard.
  
 Modern compilers universally support `#pragma once`. Use it for cleaner headers, or use traditional header guards for portability. Modern compilers universally support `#pragma once`. Use it for cleaner headers, or use traditional header guards for portability.
c-pragma-once.md · Last modified: by Ivan Janevski