Difference between unsigned and unsigned int in C++

paperjam picture paperjam · Oct 21, 2011 · Viewed 15.3k times · Source

What is the difference between unsigned and unsigned int?

This question was already answered for C (there is no difference):

Difference between unsigned and unsigned int in C

I am interested in knowing whether there is any practical difference in C++. Are they the same type?

Answer

Kiril Kirov picture Kiril Kirov · Oct 21, 2011

They are the same type, as in C. No differences at all.

Of course, unsigned can be used as a qualifier for other integral types. But by default, unsigned is the same as unsigned int.