Skip to content

fix: correct errors in string literal explanation #237

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

Merged
merged 3 commits into from
Jul 17, 2022
Merged

fix: correct errors in string literal explanation #237

merged 3 commits into from
Jul 17, 2022

Conversation

Timothy-Liuxf
Copy link
Contributor

@Timothy-Liuxf Timothy-Liuxf commented Jun 20, 2022

Description

The previous statement about string literal is incorrect. According to cppreference, a string literal is an lvalue forever, which is an array of const char.

Change List

  • Fix the statement about string literal in 03-runtime.md

Reference


说明

原来对于“字符串字面量在类中是右值”的叙述有误。根据 cppreference 对于左值的表述,字符串字面量永远是一个左值,其类型是 const char 数组

变化箱单

  • 修复了 03-runtime.md 中关于字符串字面量的表述

参考文献

@Timothy-Liuxf
Copy link
Contributor Author

The ISO C++ standard also says: https://eel.is/c++draft/expr.prim#literal


ISO C++ 标准中也有此表述:https://eel.is/c++draft/expr.prim#literal

@changkun changkun merged commit 41b88c8 into changkun:master Jul 17, 2022
@changkun
Copy link
Owner

Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants