Home > Net >  In c, what does this parameter means `myfunc(mystruct_t * const * pVar)`?
In c, what does this parameter means `myfunc(mystruct_t * const * pVar)`?

Time:11-17

Saw this pVar parameter definition in a demo program, does this means it is constant pointer value and constant pointer address?

void myfunc(mystruct_t * const * pVar) 
{
   // ...
}

CodePudding user response:

It means that pVar is a (non-const) pointer to a const pointer to a (non-const) mystruct_t object.

General rule for reading and understanding C declarations -- start from the name (pVar here) and read out from there. When there are both prefix and suffix things, the suffix things are higher precedence, so come first, unless there are parens to get the prefix things first.

  • Related