{
for (int i = 0; i < height; i++)
{
cout << "\t\t|";
for (int j = 0; j < width - 2; j++)
{
if (i == 0)
cout << "_";
else if (i == height - 1)
cout << "_";
else
cout << " ";
}
cout << "|" << endl;
}
}```
I was wondering how I could make an exact border because when I try to move the width it just disappears
this is the output:
#How to make square border using _ and |
18 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
I dont wanna get the size of rows and columns. I just wanna know how I can move the width on top so the height doesn't overlap
what does " try to move the width it just disappears" mean
you're asking for the border top to be higher? just put it one line higher then
I don't think there's an ascii character for opposite of _
you can also print unicode instead ‾
oo wait i should try that
i tried it using the unicode
but yeah when i try to put it one line higher it disappears
using namespace std;
const int width = 50;
const int height = 25;
void screen()
{
for (int i = 0; i < height; i++)
{
cout << "\t\t|";
for (int j = 0; j < width - 2; j++)
{
if (i == 0 - 1)
cout << "_";
else if (i == height - 1)
cout << "_";
else
cout << " ";
}
cout << "|" << endl;
}
}
int main()
{
screen();
return 0;
}```
!solved