Hollow Rectangle function

I know this question probably gets asked often enough, but I was just hoping someone could tell me what is wrong with my code.. or really just hint at it. I am creating a function that takes in a width and height and gives a trace of a rectangle with those dimensions, however I cannot get the inside to be hollow. As of now, I have the middle showing as 0's so I can see what my code is doing.

This syntax is most likely not doing what you want it to. Let me try to explain why. The above line is what's called an 'expression', and an expression is a thing which can contain sub-expressions, and is evaluated according to operator precedence. For instance:

// Same precedence, but with left to right associativity
4 > 3 > 2; // ((4 > 3) > 2)

This will evaluate to false, because (4 > 3) evaluates to a true or false value, either 1 or 0 (respectively). So picture it being evaluated:

Code:

((4 > 3) > 2);
((1) > 2); // false;

2. You are printing straight to output, which naturally inserts new characters to the right of older ones, and then goes downward (in the same manner that a person reads). This can make drawing difficult, because you are forced to do things in a specific order (eg, draw the top, then sides, then bottom). Instead, what if you mimicked the output by creating a character buffer:

Code:

char output[CONSOLEHEIGHT][CONSOLEWIDTH];

Then you could more easily draw to the array, and then only copy the array to output when the characters for the rectangle are already set (and you can do so in any order).