athos athos - 20 days ago 7x
C++ Question

What does `long unsigned typedef int long ullong;` mean?

In cppreference page of typedef, there's an example:

// typedef can be used anywhere in the decl-specifier-seq
long unsigned typedef int long ullong;

I can't figure out what this mean.... pls help?


It means the same thing as

typedef unsigned long long int ullong;

The five words typedef, unsigned, long, long, and int are decl-specifiers forming a single decl-specifier-seq, and (with some possible edge case exceptions) the meaning or validity of a decl-specifier-seq does not depend on the order of the decl-specifiers.

Note that int static x; means the same thing as static int x;, and void virtual f(); means the same thing as virtual void f();, to give some additional examples.