BGR: iPhone 14 Pro Models Will Come In Different Sizes Than Regular Versions iPhone 14 Pro Models Will Come In Different Sizes Than Regular Versions What is the difference between .size() and .length ? Is .size() only for arraylists and .length only for arrays? If the size of the int is that important one can use int16_t, int32_t and int64_t (need the iostream include for that if I remember correctly).

Understanding the Context

What's nice about this that int64_t should not have issues on a 32bit system (this will impact the performance though). What does the C++ standard say about the size of int, long? I found two ways to determine how many elements are in a variable… I always get the same values for len () and size (). Is there a difference?

Key Insights

Could size () have come with an imported library (like... In this case, depending upon what your use case is, you might be better off using int (or long long) for s1 and s2. There are some functions in C/POSIX that could/should use size_t, but don't because of historical reasons. For example, the second parameter to fgets should ideally be size_t, but is int. In several C++ examples I see a use of the type size_t where I would have used a simple int.

Final Thoughts

What's the difference, and why size_t should be better?