replace « STL Algorithms Modifying sequence operations « C++






1.Use the generic replace algorithm to replace all occurrences of R by S
2.Use std::replace to replace elements in vector by value
3.Use replace to replace all elements with value 6 with 42
4.Use replace to replace all elements with value less than 5 with 0