In c we use \n for the next line. Is there any way to go to previous line?
In c we use \n for the next line. Is there any way to go to previous line?
No, \n simply means line-feed, ie there is a new-line following (punctuation). You'd have to rewind back to the last line-feed.
If you u trying to do something like that in the console, then there are no way to go back to the previous line, unless if you are working on files either you could use fseek or rewind to go back to top of the file and work around to come back to the appropriate line.
ssharish2005
You might try \v
Though to be honest, if you need a lot of random positioning of the cursor on a console screen, it would be much better to use a library such as ncurses.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I have tried \v. But it printed only as special symbol. Will you please tell me how to use that library ncurses?
Is there something wrong with the existing ncurses documentation, FAQ and tutorial sites?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.