Change specific ostream lines

Hi,

Is it possible with an ostream like cout to change specific lines into new text?
Not once you displayed the line, at least with a standard library
What are you asking exactly?


I second PanGalactic, but I'll take a guess. Do you mean changing specific locations in the ostream (like, certain spots on the console) and printing stuff there?
Keep in mind that if you print characters on an area that already has text you will simply overwrite it. (If you for example moved the cursor on top of text already present on your console.)
If if want to write to a specific location on the console and/or overwrite it afterward; and thus create a console application that "takes over the entire console" similar to vi, ncurses is a useful library.

If you wanted to perform some sort of filtering on text sent to a specific ostream, such as cout, you could write a wrapper class. Using the Decorator pattern, could make the additional responsibilities or filters run-time swappable.
Topic archived. No new replies allowed.