Is there any performance penalties has 1st sample vs. 2nd one and why?
// 1. variable is declared inside the loop body
while(isSomethingTrue == true) {
std::string str;
findStr(str); // str initialization
processStr(str); // processStr does not change its argument
}
// 2. variable is declared outside the loop body
std::string str;
while(isSomethingTrue == true) {
findStr(str);
processStr(str);
}