Lets say i need a c++ string to be cleared in a loop each looping.
Which one is better?
N°1
N°2Code:for(j=0; j<=9; j++) { string current; current+= dataset[array[j]]; }
I think about the second because the string wont get declared everytime but maybe its the same?Code:string current; for(j=0; j<=9; j++) { string = ""; current+= dataset[array[j]]; }