gpt4 book ai didi

c++ - C预编译器不区分大小写?

转载 作者:行者123 更新时间:2023-11-30 20:56:13 25 4
gpt4 key购买 nike

我正在写以下内容

#ifdef points 
#define points

class Points
{
};

#endif

后来我发现我无法申报Points积分;

我必须更改为

#ifdef points_h
#define points_h

那么,ifdef 不区分大小写吗?

最佳答案

为什么不自己尝试一下呢?

#include <iostream>

#define points

int main() {
#ifdef Points
std::cout << "yes";
#else
std::cout << "no"; //this happens
#endif
return 0;
}

关于c++ - C预编译器不区分大小写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26826080/

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