Should I use
#ifndef _HEADER_H_
#define _HEADER_H_
etc. in every header file?
Should I use
#ifndef _HEADER_H_
#define _HEADER_H_
etc. in every header file?
Yes, it is good practice to guard every header. There are two commonly used ways to do that:
#ifndef UNIQUE_IDENTIFIER // the identifier musn't start with "_"!
#define UNIQUE_IDENTIFIER
// your code here
#endif
The second is technically not required to be supported by the compiler, but is by most modern compilers. You cannot make an error (e.g. typo, duplicate identifier) with this approach:
#pragma once
// your code here