问题:
I always mess up how to use const int*
, const int * const
, and int const *
correctly. 我总是搞砸了如何正确使用const int*
, const int * const
和int const *
。 Is there a set of rules defining what you can and cannot do? 是否有一组规则定义您可以做什么和不能做什么?
I want to know all the do's and all don'ts in terms of assignments, passing to the functions, etc. 我想知道在分配,传递给函数等方面所有需要做的事情。
解决方案:
参考一: https://stackoom.com/question/4nPi/const-int-const-int-const和int-const-有什么区别参考二: https://oldbug.net/q/4nPi/What-is-the-difference-between-const-int-const-int-const-and-int-const
来源:oschina
链接:https://my.oschina.net/stackoom/blog/3221707