New to C++. Question about constant pointers

前端 未结 10 1901
梦谈多话
梦谈多话 2021-02-10 06:55

I am trying to learn C++ via some web tutorials. I don\'t have a compiler available to me, otherwise I would try this out. I\'m not sure what is meant by a const pointer. Doe

10条回答
  •  闹比i
    闹比i (楼主)
    2021-02-10 07:20

    A const pointer means that you can change the value of the variable which is being pointed to, but you can't change where the pointer is pointed. I don't use them often myself, but a common application for const pointers is in defining specific memory segments that you need to address. See this question for more information.

    As an aside, you should try to get a compiler on your computer if you can. I've shown myself many times that human brains are poor C++ compilers.

提交回复
热议问题