header-guard
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| header-guard [May 14, 2026 at 12:52] – yanevskiv | header-guard [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # Header guard | ||
| - | **Header guards** are a pattern used in C and C++ programming languages when writing header files. | ||
| - | Header files are files that | ||
| - | A prototypical example of a header guard is the following | ||
| - | ```c | ||
| - | // my_header.h | ||
| - | #ifndef __MY_HEADER_H__ | ||
| - | #define __MY_HEADER_H__ | ||
| - | |||
| - | struct Hello { | ||
| - | const char *world; | ||
| - | }; | ||
| - | |||
| - | #endif /* __MY_HEADER_H__ */ | ||
| - | ``` | ||
header-guard.1778763130.md.gz · Last modified: by yanevskiv
