What is #pragma used for?

前端 未结 2 1710
离开以前
离开以前 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:22

    • What -- it is header guard. This file will be included only once.
    • When -- at a compile process
    • why -- to avoid double including.

    "Header guards are little pieces of code that protect the contents of a header file from being included more than once."

提交回复
热议问题