So you want to do something like this?
eeeeeeeeeeeeeeeee
e e
e e
e e
eeeeeeeeeeeeeeeee
but don't know how? Or you want this?
eeeeeee
e e e
e e e
eeeeeee
but it ends up like this?
eeeeeee
eee
eee
eeeeeee
Can you elaborate please? I'm not sure what you are trying to do.
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
Did you try to incorporate any of DangerDev's code? Some of the lines using "printf" had problems, but when fixed, yielded a box that lined up for me. You could either change the "printf" statements to make them work or simply convert the "printf" statements to "cout" statements.
You say you "get too many spaces". In your original code that you posted I don't see you displaying any spaces at all. I am assuming that in this line:
cout << c;
c represents a character and that c is not a space. Please let us know whether you have gotten this working and, if not, please post some updated code.
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
for (int myHeight =0; myHeight< myHeight; myHeight++)
Look at this line. This loop will never be executed due to the condition you have imposed:
myHeight < myHeight
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711