devxlogo

Clearing the Contents of a String

Clearing the Contents of a String

To explicitly erase the contents of a string object, you can use the member function erase():

 void f(){  char key;  string msg = "press any key to continue";  cout

devx-admin

Share the Post: