Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

# pragma directive and its uses in c

Tags:

c

pragma

can anyone tell my what does the #pragma can do in the c language . what are its uses and why the above program is not giving the output 'inside v1'& 'inside v2' in the following program ...

# include<stdio.h>
void v1();
void v2();
# pragma startup v1

# pragma exit v2

int main()
{
printf("inside main\n");
return 0;

}
void v1()
{
printf("inside v1\n");

}
void v2()
{
printf("inside v2\n");
}

i also want to know what a are the uses of the #pragma directive .... plz help

like image 976
sandy101 Avatar asked Jan 22 '23 05:01

sandy101


1 Answers

#pragma are compiler/vendor specific directives to the compiler. You'd have to look up the documentation for the particular compiler you're using.

like image 52
nos Avatar answered Jan 31 '23 02:01

nos