mardi 18 juin 2019

how can i replace all the white spaces with any special character using stream manipulators?

For example, I got an input from the user "This is a sample program" using cin, I want to replace every white space with a special char and display it back like "This\is\a\sample\program".

note: special character can be anything. ex: * or & or $ etc....

I want to do this using stream manipulator. is it possible?

Aucun commentaire:

Enregistrer un commentaire