Using sprintf with WriteConsoleOutput

So I have a task to use sprintf with WriteConsoleOutput. Now my problem is I'm not to sure how I can use sprintf() to display to a coord on the screen.

So if I'm using this function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void BlitArrayToConsole( CHAR_INFO (&OffScreenBuffer)[WINDOW_HEIGHT_SIZE][WINDOW_WIDTH_SIZE] )
{
	COORD offscreenBufferBuff;
	offscreenBufferBuff.X = WINDOW_WIDTH_SIZE;
	offscreenBufferBuff.Y = WINDOW_HEIGHT_SIZE;

	COORD dest;
	dest.X = dest.Y = 0;

	SMALL_RECT  rt;
	rt.Top = 0;
	rt.Bottom = WINDOW_HEIGHT_SIZE;
	rt.Left = 0;
	rt.Right = WINDOW_WIDTH_SIZE;

	WriteConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE), &OffScreenBuffer[0][0], offscreenBufferBuff, dest, &rt);
}


How exactly would I go about using sprintf() on the screen at the coords of etc - 10y and 10x to say "Hello World".

Just something really basic like that?

Thanks,
Myth
sprintf() just formats a string, using the printf() format specifiers. It doesn't display the result in any way.
So your saying I'd have to still use printf() to display the c-string?
Topic archived. No new replies allowed.