Say I have a variable name len
in a function and several strings. Can I use this to store length of those strings one after the other or should I create separate variables?
Basically this:
size_t len;
len = string1.size()
....//some code
len = string2.size()
...//more code
versus
size_t str1len, str2len;
str1len = string1.size()
....//some code
str2len = string2.size()
...//more code
All are local variables within a function BTW.