0

How can i draw a 1 line border or frame around code using an " * " , searching the net i have seen techniques using loops and various functions but i cant grasp the concepts being used, even a link to a indept tut on this would be a great help.

Edited by Stpdoug

3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by Stpdoug
0

If you do not understand the concept of loops then no tutorial on drawing borders is going to help. Perhaps you should start by trying to use a loop to draw a straight line of a given size. From there, you can begin to extend your approach to multiple nested loops.

0

Try this :

for ( int i = 0; i < 10 ; i++ )
{
   cout<< "*" ;
}

It creates a border like this:
**********

Similarly for vertical part use a cout<<endl so that after printing a star you can move to next line. Try it.

0

i agree buit i am not completely oblivious to the concept loops but a tutorial would help me i have done calulations using loops but not anything remotely close to drawing a border...
if you know of any please post a link

Edited by Stpdoug

0

i did a little bit of reading up and practicing

for (int i=o; i<10; i++)
{

for (int a=o; a<10; a++)
   {
   printf("*");
   }

printf("*/n");
}

i know i need to fill this out with some if statements as i was reading a previous thread of a similar topic but then how would output statemetns be written within a box using nested for-loops and if else statements?

Edited by Stpdoug

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.