Posts

Showing posts with the label Pragmas

Pragmas in C language

Pragma directive is a method specified by the C standard for providing additional information to the C compiler.Basically it can be used to turn on or turn off certain features.Pragmas are operating system specific and are different for every compiler. Examples of some of the pragmas  are #pragma startup,#pragma exit Example of #pragma startup: Syntax:  #pragma startup <function name> [priority] By using #pragma startup directive we can call the functions on startup before main function execution #include<stdio.h> void print1() { printf("Before Main 1\n"); } void print2() {     printf("Before Main 2\n"); } #pragma startup print1 0 #pragma startup print2   1 int main() {                                                   printf("In Main\n");     return 0; } This will n...