0

What is "#pragma once"?

What is "#pragma once" in visual studio c++ header files?

21st Mar 2020, 2:12 PM
Santosh Pattnaik
Santosh Pattnaik - avatar
1 Answer
+ 1
#pragma once --> sometimes there will be a header file that many other header files use. Each one #includes it. Then when your program #includes those files, you get warnings about multiple definitions. This directive ensures that the header file will get included only once and avoid the warnings.
22nd Mar 2020, 3:53 PM
Brian
Brian - avatar