Double const declaration

后端 未结 8 1497
花落未央
花落未央 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:30

    This makes it a const pointer to a const value, rather than a mutable pointer to a const value or a const pointer to a mutable value.

提交回复
热议问题