I allready implemented some other methods while listening to the video…
I did use the code snippet functionality for visual studio (type “for” then press <tab> <tab>). It gave me a size_t instead of an int.
Why does it do that?
Edit: tab tab
I allready implemented some other methods while listening to the video…
I did use the code snippet functionality for visual studio (type “for” then press <tab> <tab>). It gave me a size_t instead of an int.
Why does it do that?
Edit: tab tab
size_t is an unsigned type (no negative numbers) and can store the maximum size of a theoretically possible object of any type. It’s commonly used for loops and array indexes. Also the return type for most (if not all) of the .size()(or .length()) functions in the Standard Library containers (std::string, std::vector, etc.)
Thanks!
I’ll need to get my head around this at some point:
maximum size of a theoretically possible object of any type
but basically I should use this because it should be able to hold any length, right?
Basically, and that sentence just means it should be able to hold the max size of an object including an array.