+ 2
Why Pragma's are used in C++??
!?🤔
5 odpowiedzi
+ 4
The preprocessor directive #pragma is used to provide the additional information to the compiler in C/C++ language. This is used by the compiler to provide some special features.
1.) #pragma startup
Before the execution of main(), the function specified in pragma is needed to run.
2.) #pragma exit
Before the end of program, the function specified in pragma is needed to run.
3.) #pragma warn
Used to hide the warning messages.
I hope this helps u
+ 2
The pragma directive is used to access compiler-specific preprocessor extensions.
Learn more about it here👇
https://www.tutorialspoint.com/hashpragma-directive-in-c-cplusplus
+ 1
Hmmm🙂
0
Is there any pragma directive in other languages???
0
Just for instance, some of compiler features are not easily accessible from the interface (kind of), so using pragma directives can reach it with its extensions.
Example : E/D warnings extras sollicited by (#pragma warn).