Hi! I finished the BullCow part and there is the appeared question:
#pragma once in cpp files? You added pragma once to all files in project and this confused me a little bit.
Let me explain, how i see #pragma once - according to wiki: “#pragma once serves the same purpose as include guards”, which, “include guard, sometimes called a macro guard or header guard” and it does that “The addition of #include guards to a header file is one way to make that file idempotent.”
I mean - it’s HEADER guard, so i have two questions for this lection:
- Why should we use #pragma once in cpp files?
- Why using #pragma once twice - in header and in cpp?