Jump to content
  • Advertisement
Sign in to follow this  
n0ob

Rewinding stdout not working..

This topic is 5393 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to write a buffer to stdout, go back to the start, and write another one. I guess this isn't possible? I've tried rewind, fseek(stdou, 0, SEEK_SET), and a couple other things. I just can't get anything to work here :| Any ideas? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
What if i wanted to write a few strings, then write something else over the top of them??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you might like the "\r" special character, which is just a carriage return (instead of newline + carriage return.)

i dunno.

Share this post


Link to post
Share on other sites
system("cls") gives .. acceptable results.. but.. really, there should be a file-based alternative or whatever..

Share this post


Link to post
Share on other sites
There's no standard way to do that. There's the non-standard conio library, Microsofts uber scary console API, ansi escape codes, and in *nix you have ncurses.

Share this post


Link to post
Share on other sites
You can use the Win32 console functions to set the cursor position back to (0,0). But as far as I'm aware, theres no way to do it with standard C. What if the console output is a printer (which it might be on some embedded systems)? You can't feed the paper back in and write over it again.

Share this post


Link to post
Share on other sites
If I engineer'd a printer, you would be able to. Anyway, I know about conio and the writeconsoleoutput stuff, but I'm trying to do this with the standard crud or whatever. Thanks for all your help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!