Reputation: 3
I'm already familiar with system ("cls") but it deletes all of the text above it and I just need to delete some of the text not all.
Upvotes: 0
Views: 70
Reputation: 490048
[Based on the reference to cls
, I'm assuming this is code running under Windows.]
It depends on whether you need portability.
If you want (reasonably) portable code, you can use curses
, an old text-mode Windowing library, originally written for terminals under Unix, but now implemented on most other systems (Linux, Windows, MacOS, etc.)
If you don't care about portability, Windows provides FillConsoleOutputCharacter, which will let you fill parts of a console with arbitrary characters. To "delete" text, you normally fill that area with spaces.
Upvotes: 1