-3

What does uint means in c++ while the declaration of a variable in class?

See here for the referance.

Is it part of a c++ library such as eigen/core?

Does that mean unassigned int?

I searched on google but could not find anything concrete.

Darshan
  • 71
  • 11
  • 1
    It's short (alias) for `unsigned int;` – πάντα ῥεῖ Jan 27 '21 at 01:10
  • 1
    The first thing I find when I google "C++ uint" is [this question](https://stackoverflow.com/questions/3552094/c-uint-unsigned-int-int) which seems to cover it pretty well. – Nathan Pierson Jan 27 '21 at 01:12
  • If you find yourself wanting define some of these `uint`s for your own uses, C++ has [had a whole array of them since C++11](https://en.cppreference.com/w/cpp/types/integer). We stole them from C99. Bit late to the game, but at least we played. – user4581301 Jan 27 '21 at 01:22
  • Please check [this](https://stackoverflow.com/questions/3552094/c-uint-unsigned-int-int#:~:text=C%2B%2B%20defines%20no%20such%20type,int%20though%20or%20something%20else.) – circassia_ai Jan 27 '21 at 01:48

3 Answers3

2

It means whatever the author decided it means!

uint is not part of C++, so it must come from one of the libraries used by that code. Some Googling tells us that it is indeed Eigen.

By convention, it's an unsigned integer type, probably one without a fixed width, so unsigned int.

Asteroids With Wings
  • 17,071
  • 2
  • 21
  • 35
0

The u in uint stands for unsigned, so uint is an unsigned int, whose value will be >= 0.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Tom Gebel
  • 744
  • 1
  • 4
  • 13
  • This is a reasonable guess, but it is by no means guaranteed to be correct. See the other answers for more details. – Pete Becker Jan 27 '21 at 15:31
0

in C++ there isn't any type defined as uint but it must be a typedef of your library that you're using and it's intuitive that u prefix before an int means unsigned integer example uint8_t, uint32_t etc.

here is how it might be defined

typedef unsigned int unit;
thakee nathees
  • 877
  • 1
  • 9
  • 16