'john' <ea********@fastmail.fm> wrote in message
news:1d**************************@posting.google.c om
OK, what is the simplest way of drawing lines, vertical and horizontal
in Microsoft visual C++ or Dev C++
I don't know why anyone would want to bother drawing lines in console mode,
but you need to look at the character set of the font that your console
uses. It probably incorporates some special characters for the purpose. For
example, under Windows the default font is 8514oem. Characters 0xB3 to 0xDF
are line drawing charactes. For example, 0xB3 is a vertical line, 0xC4 is a
horizontal line and 0xBF, 0xC0, 0xD9, 0xDA are corners. Thus you can draw a
square with:
cout << 'n';
// top line and corners
cout << (char)0xDa;
for(int i=0; i<10; ++i)
cout << (char)0xC4;
cout << (char)0xBF;
cout << 'n';
// vertical edges
for(int i=0; i<10; ++i)
{
cout << (char)0xB3;
for(int j=0; j<10; ++j)
cout << ' ';
cout << (char)0xB3;
cout << 'n';
}
// bottom line and corners
cout << (char)0xC0;
for(int i=0; i<10; ++i)
cout << (char)0xC4;
cout << (char)0xD9;
cout << 'n';
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)