Ummmm what in the name of all that is holy are you doing it like that for? I was going to post code but now that I have read you can't use arrays... I refuse to post anything other than a suggestion.
You can always use %*s within printf() to print x number of characters in a string. So for the dashes, you can make a string literal with ample dashes in it, then use printf() with %*s to specify how many dashes you need per line segment.