Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于#define宏常量和const常量的区别 第四点 #4

Open
xbQAQ opened this issue Aug 6, 2022 · 1 comment
Open

关于#define宏常量和const常量的区别 第四点 #4

xbQAQ opened this issue Aug 6, 2022 · 1 comment

Comments

@xbQAQ
Copy link

xbQAQ commented Aug 6, 2022

在第四点中
是否可以做函数参数
宏定义不能作为参数传递给函数
const常量可以在函数的参数列表中出现

我觉得宏定义是可以作为参数传递给函数,宏只是一个简单的替换,也是可以放在函数参数中,无论是实际参数传递还是作为形参部分都是可以的

@guaguaupup
Copy link
Owner

我仔细查了一下,发现宏确实可以作为函数参数。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants