Use of #pragma in C

前端 未结 10 1784
囚心锁ツ
囚心锁ツ 2020-11-27 09:32

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

10条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 10:07

    This is a preprocessor directive that can be used to turn on or off certain features.

    It is of two types #pragma startup, #pragma exit and #pragma warn.

    #pragma startup allows us to specify functions called upon program startup.

    #pragma exit allows us to specify functions called upon program exit.

    #pragma warn tells the computer to suppress any warning or not.

    Many other #pragma styles can be used to control the compiler.

提交回复
热议问题