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

建议在 简介-常见错误 中添加 使用关键字作为变量名 #2065

Closed
wenjunrui opened this issue Mar 15, 2020 · 3 comments
Closed

Comments

@wenjunrui
Copy link

如 next,y1,y0 等

@welcome
Copy link

welcome bot commented Mar 15, 2020

感谢你对 OI Wiki 的关注!记得在 Issue 中表达清楚自己的意思哦~

@cubercsl
Copy link
Contributor

感觉描述欠妥。都不是不能使用。
使用 next 造成错误的原因是和 std::next 函数重名,不是关键字。只要不使用 using namespace std 导入命名空间就好。
使用 y1 造成错误是由于 cmath 库里存在了全局的 y1,因此在 include 相关头文件时不能在全局使用 y1

@H-J-Granger
Copy link
Contributor

同意楼上。
补充一下,next,y1,y0从来就不是关键字

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

3 participants