Use of #pragma in C

srujan picture srujan · Oct 24, 2008 · Viewed 198.5k times · Source

What are some uses of #pragma in C, with examples?

Answer

Steven A. Lowe picture Steven A. Lowe · Oct 24, 2008

#pragma is for compiler directives that are machine-specific or operating-system-specific, i.e. it tells the compiler to do something, set some option, take some action, override some default, etc. that may or may not apply to all machines and operating systems.

See msdn for more info.