#pragma once does exactly the same as creating header guards, however, pragma is not supported by all compilers.
If you need a reminder of what header guards are:
Header guards prevent a file from being included in the same file more than once.
1 2 3 4 5 6 7 8 9
//file.h
#ifndef FILENAME_H
#define FILENAME_H
//code here
#endif
//main.cpp
#include "file.h" //includes the code between #ifndef en #endif
#include "file.h" //includes nothing, as FILENAME_H is already defined and the #ifndef evaluates false
I recommend using regular header guards rather than #pragma once, because, as I already said, pragma isn't supported by all compilers.