cppforever.com

Include Guards

Purpose: Prevent multiple inclusion of the same header.

#ifndef MYHEADER_H
#define MYHEADER_H

// Header content

#endif // MYHEADER_H

Alternative: #pragma once — not part of the C++ standard, but widely supported and considered standard practice in modern C++ projects.