#ifndef HEADER_H

#ifndef HEADER_H
vs
#pragma once

Attached: cpp_logo.png (918x1032, 45K)

Hi there. The answer is #ifndef HEADER_H because it allows you to do the following.
#ifdef H_ONCE
#ifdef H_TWICE
#ifdef H_THRICE
#else
#define H_THRICE
class ObjectThree {
};
#endif
#else
#define H_TWICE
class ObjectTwo {
};
#endif
#else
#define H_ONCE
class ObjectOne {
};
#endif

This means that if I want to use ObjectTwo in my object, I will include this header twice.

#include "header.h"
#include "header.h"

And if I want to use ObjectThree, I will include the header 3 times while also getting access to ObjectOne and ObjectTwo.

Why? Because you want to take all of your class definitions and put them into one header. Then include that header a certain number of times depending on the combination of classes you need. This ensures job security.

I fucking hate guys like you.

Reminder to learn C and C# before touching C++, if at all

doesnt c++17 have a better answer to this?

>ISO vs common extension
hard to say, imho at this point #pragma once is acceptable in C++ world
I would still use include guards in C
so definitive answer: use whatever the guideline tells you to use

>shitty standard
>vs
>slightly better non-standard that is supported by everyone but Cray supercomputer compilers

>falling for 'C#' name
kek

Neither because it's useless.

Easily the pragma. If your compiler doesn't support it, it's shit.

It's easy to write a shell script that will translate from pragma to ifndef if you need to use a really obscure compiler.

>This ensures job security.
I fucking lost

It also ensures eternal damnation.

How the hell are modules going to (hopefully?) work?

This is glorious.

#pragma once is also preferable in C, only use include guards for legacy or on arcane platforms

pragma once is the only non sub human way

#pragma once will probably be easier to optimize for than than making assumptions about include guards

would be easy to spot this shit with tools and if you got caught, it would be obvious you were being a bitch or a literal retard.

The correct answer is to not use languages with header files unless you really hate compilation times and memory consumption.

This guy fucks.

i agree that c++ is shit but unfortunately c's probably still the best language for crap like operating systems

It's a meme, you can write operating systems in a lot of languages.

Pragma once is supported by most compilers

Take notes lads

Is there something like the tour book for C#?