I was making a program and had defined a file called Constants.h in it. When I tried to include it in main.cpp and in another class declaration player.h, I got an error that varible_xyz was defined more than once.
So, I googled up this issue and came to know that header guards can be used to prevent the inclusion of a file multiple times as this post says: http://www.cplusplus.com/forum/general/71787/ . But how do we use #pragma once in our codes?
I'd be very grateful if someone can give me a simple example or a link where this basic issue is addressed.