replacing char

I want to replace a cout with spaces
  //I have 
cout << "-"

I want to replace - with just one space everywhere in my program how can I do that?
Last edited on
More like a find and replace?
Yes. How would I do that?
you need to implement a character search, I'll assume that you already have something like


a character search will go through the string test each character starting from H to the last character x,

then you can test if its equal to -
if false you can store that character in a string and continue testing the next
if true you replace that and store " " instead of the character -

That is how I would do it. hope the knowledge helps. try it provide source code and we will correct were needed.
Topic archived. No new replies allowed.