What is #pragma used for?

前端 未结 2 1712
离开以前
离开以前 2020-12-14 07:42

Can anyone help me understand #pragma?

ifndef TARGET_OS_LINUX
#pragma once
endif

What,when, where, why, an example?

The above is in

2条回答
  •  臣服心动
    2020-12-14 08:27

    #pragma is just the prefix for a compiler-specific feature.

    In this case, #pragma once means that this header file will only ever be included once in a specific destination file. It removes the need for include guards.

提交回复
热议问题