Search code examples
cpointersconstantsvolatile

volatile and const pointer


I saw this code snippet

const volatile int * volatile * const X;

but I can't understand what does the second * means.

I understand that

const volatile int * volatile const X;

means a volatile const integer pointer to a volatile const data.


Solution

  • A useful site for understanding non-trivial C declarations is cdecl.org.

    The description for:

    const volatile int * volatile * const X;
    

    from cdecl is:

    declare X as const pointer to volatile pointer to const volatile int