• 0

C++ mvwprintf function in windows.


Question

Under linux, in the curses library, there is a function called "mvwprintf" which prints something at a specified location on the screen. For example, mvwprintf(4,3, "Hello world") will print "Hello world" starting with 'H' at the 3rd column of the 4th row.

Is there a windows equivalent for this?

Thanks.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

No, but it is trivial to roll your own.

int mvprintw( int y, int x, const char *fmt, ... )
{
	COORD coord = { x, y };
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
	return(vprintf(fmt, (va_list)((void**)&fmt + 1)));
}

Edited by kliu0x52
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.