C++ cout code

Hi ,
can someone point me to the code for doing cout << for printing text that is inside a box on the screen.. and this code would not use VC+ code just c++ code

what is a 'box' ?
Like this?
+-------+
| Hello |
+-------+
He probably means a GUI window.
yes the following is what I would need.. would it be enabled with \n

+-----------+
| Hello |
+-----------+
pseudocode:
1
2
3
4
5
6
7
8
len = length of the string
output '+'
output len '-'
output '+\n'
output '|'
output your string
output '|\n'
repeat line 2, 3, 4

Last edited on
thank you
Like this?
1
2
3
4
5
6
7
8
9
10
11
12
13
string s = "Hello";

cout << "+-";
for( int i = 0; i < s.length(); ++i )
{
    cout << "-";
}
cout << "-+" << endl << "| " << s << " |" << endl << "+-";
for( int i = 0; i < s.length(); ++i )
{
    cout << "-";
}
cout << "-+" << endl;

This would make for a nice function...
Last edited on
Topic archived. No new replies allowed.