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

指针常量和指向常量的指针 #7

Open
BigLun5516 opened this issue Nov 4, 2021 · 0 comments
Open

指针常量和指向常量的指针 #7

BigLun5516 opened this issue Nov 4, 2021 · 0 comments

Comments

@BigLun5516
Copy link

https://github.com/balloonwj/CppGuide/blob/master/articles/C%2B%2B%E5%BF%85%E7%9F%A5%E5%BF%85%E4%BC%9A%E7%9A%84%E7%9F%A5%E8%AF%86%E7%82%B9/%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3CC%2B%2B%E4%B8%AD%E7%9A%84%E6%8C%87%E9%92%88.md

  • 第一段关于指针常量的描述没有问题,指针常量为 * const,一旦指定,不能再指向别的变量,但其指向的内容可以更改
  • 但第二段举的例子却是指向常量的指针,即 const *,不能通过这个指针改变指向变量的值,但这个指针可以再指向别的变量
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

1 participant