gpt4 book ai didi

c - 在 C 中,如果用未定义的东西定义一个变量会发生什么?

转载 作者:太空宇宙 更新时间:2023-11-04 02:13:42 25 4
gpt4 key购买 nike

我有一个这样的示例代码:

int var;
var = MACRO_A;

我希望 MACRO_A 是这样定义的:

#define MACRO_A    1234

但是,我没有在源代码的任何地方找到定义的MACRO_A,但是我可以成功构建代码,那么var的值是多少 最后 ?

编译器是gcc。

最佳答案

However, I can not find the MACRO_A defined anywhere in the source code, but I can build the code successfully, so what is the value of var at the end

它在某处,否则无法编译。也许它是直接在命令行上定义的? (-DMACRO_A)

关于c - 在 C 中,如果用未定义的东西定义一个变量会发生什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10339150/

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