What does #pragma once mean in C?

wireshark picture wireshark · Apr 25, 2011 · Viewed 66.7k times · Source

Possible Duplicate:
#pragma - help understanding

I saw the pragma many times,but always confused, anyone knows what it does?Is it windows only?

Answer

helpermethod picture helpermethod · Apr 25, 2011

In the C and C++ programming languages, #pragma once is a non-standard but widely supported preprocessor directive designed to cause the current source file to be included only once in a single compilation. Thus, #pragma once serves the same purpose as #include guards, but with several advantages, including: less code, avoiding name clashes, and improved compile speed.

See the Wikipedia article for further details.