Double const declaration

后端 未结 8 1492
花落未央
花落未央 2021-02-05 13:20

I often see the following function declaration:

some_func(const unsigned char * const buffer)
{

}

Any idea why the const is repeated before th

8条回答
  •  青春惊慌失措
    2021-02-05 13:33

    const * unsigned char const buffer means that you cannot modify the pointer buffer nor the memory that buffer points to.

提交回复
热议问题