Double const declaration

后端 未结 8 1479
花落未央
花落未央 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 13:46

    It's a constant pointer to a constant unsigned char. You can't change the pointer nor the thing it points to.

提交回复
热议问题