Aug 5, 2010 at 3:56pm UTC
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
Aug 5, 2010 at 5:02pm UTC
He probably means a GUI window.
Aug 5, 2010 at 5:06pm UTC
yes the following is what I would need.. would it be enabled with \n
+-----------+
| Hello |
+-----------+
Aug 5, 2010 at 5:28pm UTC
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 Aug 5, 2010 at 5:28pm UTC
Aug 5, 2010 at 5:32pm UTC
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 Aug 5, 2010 at 5:34pm UTC