r/C_Programming • u/Yuki_pop • 27d ago
Could someone explain the practical differences between #pragma once and traditional include guards (#ifndef, #define, and #endif)?
82
Upvotes
r/C_Programming • u/Yuki_pop • 27d ago
View all comments
4
u/TheLimeyCanuck 27d ago
It's just syntactical sugar. They do the same thing but the #ifndef method always works whereas #pragmas are not always supported.