print a gray block on the screen

I am working on a project where I have to print grid lines on the screen. I have sample code that does this. When I insert the code and #inlcudes into my project it displays a '?'.

The sample code is:

#include <windows.h>
#include <iostream>
#include <tchar.h>

const char graybar = '\xB2';

for(x=0; x<80; x++) // vertical borders
{
y=0;
setxychar(x,y,&graybar,1);
y=24;
setxychar(x,y,&graybar,1);
}

I put this exact code into my project and get a '?' instead of a gray block.

Any help would be appreciated.
You are trying to use a Microsoft character. Make sure your console is set to Code Page 437 (the default) and that you are using the proper font.

Good luck!
I am new enough to this that I don't have a clue what you are talking about.

Where do I find this setting in Visualstudio10 using a win32 platform?
You don't.

How do you run your program?
OK, I run both projects on the same console with the same compiler and one displays a '?' and the other displays a gray block. What am I missing here?
FYI, I had to change the setting in VisualStudio10 from unicode character set to ASCii.
Since you figured out what the problem was, you should mark your thread as SOLVED so that others with the same problem can find it.

Glad you got it fixed.
Topic archived. No new replies allowed.