how to reset contents of a string c++ code example Example: how to clear a string in c++ str.clear();