c++ uint , unsigned int , int

Viewed 107945

Hi I have a program that deals alot with vectors and indexes of the elements of these vectors, and I was wondering:

  1. is there a difference between uint and unsigned int
  2. which is better to use one of the above types or just use int as I read some people say compiler does handle int values more efficiently, but if I used int I will have to check always for negative idxs which is pain.
  3. do you think iterators to be better? is it more efficient than normal indexing vectorx[idx]?

p.s the software will handle large data processes and good performance is a must have requirement

4 Answers

As other poster have noted, uint is probably a typedef for unsigned int If you're using Visual Studio, you can check that fact very quickly by pressing F12 while the text cursor is in uint to see its definition.

Related