#pragma once?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi. I'd like to use "#pragma once" in my .h files instead of the old fashioned #ifndef __FOO.H include guards,

   

It seems to work, but I get the warning symbol and the complaint "#pragma once in main file" in the left margin of the editor, although there are no actually compiler warnings.

   

Anyone know if this is OK to use, and if so, how to get rid of the warning in the editor?

   

Thanks!

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Hello,

   

Since there is no compiler warning it will not effect the functioning of application.

View solution in original post

0 Likes
6 Replies