44

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?

Community
  • 1
  • 1
paperjam
  • 8,321
  • 12
  • 53
  • 79
  • possible duplicate of [Difference between unsigned and unsigned int in C](http://stackoverflow.com/questions/7176657/difference-between-unsigned-and-unsigned-int-in-c) – StuartLC Oct 21 '11 at 10:17
  • 17
    I wouldn't vote for closing. `C` != `C++`. – Kiril Kirov Oct 21 '11 at 10:18

1 Answers1

62

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.

Blagovest Buyukliev
  • 42,498
  • 14
  • 94
  • 130
Kiril Kirov
  • 37,467
  • 22
  • 115
  • 187