12
If i am not going to modify a string then is the first option better or are both same- (I just want to iterate through the string, but since string size is big I don't want local copy to be made.)
int getString(string& str1) {
//code
}
int getString (string str1) {
//code
}
And if I do plan on changing the string, then is there any difference between the two? Is it because strings are immutable in C++?