athos athos - 1 year ago 87
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?

Answer Source

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.