In header files I've seen two main ways for defining macro to avoid including the file more than once.

1.

```
#ifndef SOME_CLASS
#define SOME_CLASS
//code ...
#endif

```

2.

```
#ifndef SOME_CLASS
//code...
#define SOME_CLASS
#endif

```

Which is more preferable and why?
['https://Stackoverflow.com/questions/6123544', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/509233/']
I'd go for the first one.

Reason: If you ever want to change the guard name (say, `SOME_CLASS` to `SOMECLASS`), you don't have to scroll all the way down to the end of file to change it too.
The best option is to use `#pragma once`. With `#define` you must be very careful when using multiple libraries as the guard name may not be unique.