gpt4 book ai didi

c - C中#define和#pragma有什么区别

转载 作者:行者123 更新时间:2023-11-30 21:46:07 34 4
gpt4 key购买 nike

到目前为止,我知道 #define 是标准的,而 #pragma 不是标准的,但它们之间还有什么其他区别。

最佳答案

尝试 Microsoft 的链接 for Pragmafor Define

定义:

The #define directive causes the compiler to substitute token-string for each occurrence of identifier in the source file. The identifier is replaced only when it forms a token.

编译指示:

The pragma directive is used to access compiler-specific preprocessorextensions. A common use of #pragma is the #pragma once directive,which asks the compiler to include a header file only a single time,no matter how many times it has been imported

关于c - C中#define和#pragma有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48838680/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com