Week 04
Lecture slides (Type Modifiers Part 2)
Pointers Visualized
Const
Type Inference
The Unsigned Type
The most common situation that you will encounter unsigned types is returned from the .size()
member functions of containers in the STL. Any time you encounter such an unsigned type, you should immediately cast it to a signed type.
int string_size = static_cast<int>(s.size());