r/C_Programming • u/Yuki_pop • 28d 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 • 28d ago
View all comments
Show parent comment
3
u/Emotional-Audience85 28d ago
I interpreted it has having the file included through different physical paths (e.g. one is a symlink to the same file).
I've never encountered this but I believe it may be an issue for #pragma, as the same file may be treated as 2 different files and the content be pasted twice, leading to compilation errors