std::string savename = name;
replace(savename.begin(), savename.end(), ' ', '_');
It doesn’t make sense or I just miss something? What is repalce? Shouldn’t it be savename.repalce instead?
std::string savename = name;
replace(savename.begin(), savename.end(), ' ', '_');
It doesn’t make sense or I just miss something? What is repalce? Shouldn’t it be savename.repalce instead?
Replace in this case is a generic c++stdlib algorithm, specifically:
void replace (ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value)
Why exactly this approach was chosen is indeed somewhat puzzling, but that’s life for you.
Oh I see. Thank you.