0

Is there an output function in C that keeps the cursor ON the last char printed and NOT after it? (Aside from using gotoxy(wherex()-1,y))

Thanks
Ami

3
Contributors
6
Replies
7
Views
10 Years
Discussion Span
Last Post by amishosh
0

No, there is no such function. If you want the cursor at the end, use an operating system specific function to move it there after the text is printed.

0
#include <stdio.h>
int main()
{
    printf("Cursor one space back!!!\b");
 
    getchar();
    return 0;
}

ssharish2005

EXACTLY what I was looking for.

Thanks!

0

The backspace erases the character underneath the cursor just like it does when you type it on your keyboard. Is that what you want?

0

Well, sorry forgot to mention that. It does display the cursor one position back. But the actual internal char is erased. But the char would be displayed. As Ancient Dragon said.

It would be useful if you just wanted to display the out put message but not use that same out message for further manipulation because the string is altered.

ssharish2005

0

I always want to overwrite the last char so I think it's ok. It's been working fine on my little testing I'm doing

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.