output

I'm trying to make a rectangle box in notepad using C++ codes. Anyone know which codes I need to use to accomplish this? I tried using ASCII and ANSI but it's not giving me the characters that I want. this is what I want to come out in notepad.
┌────────────┐
│ │
│ │
│ │
└────────────┘

I used ASCII dec values along with alt to make that here and I can also get the same results if I type it directly on notepad but when I put the same code in visual studio, it gives me a totally different character. Please help.

Seems like the forum won't let me post it properly, but it should be a rectangular box.
Last edited on
1
2
3
4
5
std::cout << "┌────────────┐" << std::endl ;
std::cout << "│            │" << std::endl ;
std::cout << "│            │" << std::endl ;
std::cout << "│            │" << std::endl ;
std::cout << "└────────────┘" << std::endl ;


OR check out this:
http://www.asciitable.com/

1
2
3
4
char toprightcorner = 191;
char botleftcorner = 192;
char botrightcorner = 217;
char topleftcorner = 218;


Then use those wherever you want that specific character.
Last edited on
thats what i did exactly for the cout, but the output for notepad doesn't give me the same characters. seems like notepad uses a different code other than ASCII or ANSI
Anyone else have any idea how I can make this work. Please
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>

int main()
{
	char a = 191; // ┐
	char l = 192; // └
	char j = 217; // ┘
	char r = 218; // ┌
	char e = 196; // -
	char i = 179; // |


	std::cout << r << e << e << e << e << e << e << e << e << e << e << e << e << a << std::endl ;
	std::cout << i << "            " << i << std::endl ;
	std::cout << i << "            " << i << std::endl ;
	std::cout << i << "            " << i << std::endl ;
	std::cout << l << e << e << e << e << e << e << e << e << e << e << e << e << j << std::endl ;
}

It works on the console but not in notepad... That's as close as I can get you.
Last edited on
yea I can make it work in console too, it's notepad that's giving me problems. Thanks for the effort to help stewbond.
Change your font to "Terminal" in notepad. (Format->Font)
Paul
that did it, Thanks so much
Topic archived. No new replies allowed.