r/C_Programming • u/Yuki_pop • 21d ago
Could someone explain the practical differences between #pragma once and traditional include guards (#ifndef, #define, and #endif)?
81
Upvotes
r/C_Programming • u/Yuki_pop • 21d ago
View all comments
20
u/Mr_Engineering 21d ago
#pragma provides compiler specific instructions and therefore nothing about it is standard or guaranteed to be portable.
Include guards are standard by implication and therefore are portable