int const * intPtr; Declare variable intPtr as a pointer to const int const int a = 4; int const * intPtr = &a; int b = 5; intPtr = &b; //compile error
int * const a; // const pointer to int int const * const a; // const pointer to const int int const * a; // pointer to const int const int * a; // pointer to const int If no type/pointer on left, the qualifier applies to type next to it right
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int const arr[3]; arr [3] const int Declare arr as array 3 of const int int * const func(float); func (float) const * int Declare func as function(float) returning const pointer to int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (*const arr)[3]; arr const * [3] int Declare arr as const pointer to array 3 of int int (* const * func[2])(float); func [2] * const * (float) int func is array 2 of pointer to const pointer to function(float) returning int
int (^(^ adder)(int))(int) adder ^(int) ^(int) int adder is a block(int) returning block(int) returning int Now you can read any kind of type declarations!!
See also • http://www.idryman.org/blog/2012/10/29/type-qualifiers/ • http://www.vineetgupta.com/2011/03/deciphering-complex-c-declarations/ • http://cdecl.org volatile, restrict