pointer-to-const conversion in C

前端 未结 6 974
傲寒
傲寒 2021-01-13 20:09

The following code compiles without warning on GCC but gives a warning in Visual Studio 2005.

const void * x = 0;
char * const * p = x;

x p

6条回答
  •  春和景丽
    2021-01-13 20:21

    You have to read the following from right to left.
    char * const * p = x;

    For Example:
    P points to a const pointer of type char.

提交回复
热议问题