can i ask smthng??
if we going to make boxes for our program,do we need to type 'putchar()' 1000 of times???
can i ask smthng??
if we going to make boxes for our program,do we need to type 'putchar()' 1000 of times???
I have no idea. Are you trying to print a sort of menu?
You can't handle the text console very well just with standard calls, like putchar().
Theoretically, you can print a screenfull with characters creating the look you want to get, but how big is a screenful? No standard library function will help there.
For windows console control, you might need to check out a <conio.h> how to,
and for unix a <curses.h>
These are headers that contain system-specific console based input/output functions.
But for a new programmer they can be too much to take...
A typical example of ...cheap programming practices.Code:... goto johny_walker_red_label; johny_walker_blue_label: exit(-149$); johny_walker_red_label : exit( -22$);
Try this:
(straight out of Turbo C )Code:Example: #include <stdio.h> /* define some box-drawing characters */ #define LEFT_TOP 0xDA #define RIGHT_TOP 0xBF #define HORIZ 0xC4 #define VERT 0xB3 #define LEFT_BOT 0xC0 #define RIGHT_BOT 0xD9 int main(void) { char i, j; /* draw the top of the box */ putchar(LEFT_TOP); for (i=0; i<10; i++) putchar(HORIZ); putchar(RIGHT_TOP); putchar('\n'); /* draw the middle */ for (i=0; i<4; i++) { putchar(VERT); for (j=0; j<10; j++) putchar(' '); putchar(VERT); putchar('\n'); } /* draw the bottom */ putchar(LEFT_BOT); for (i=0; i<10; i++) putchar(HORIZ); putchar(RIGHT_BOT); putchar('\n'); return 0; }
12 putchar's will do ya!
I have two compilers: VS 6.0 and a very old Turbo C.
The VS is clumsy and slow. I either get help that isn't enough, or help that forces me to wade through other programming languages help, included in the suite. It's a PITA, to be kind about it.
The Turbo C is fast, I know several of their help examples locations by heart, after all these years.
I thought I'd give the free VS offering a try. My email server dumped it as spam. So I set it up more liberally, and went to try it again. MS won't send another copy, thank you very much.
I wouldn't post someone else's code without giving them due credit in the post, in any case.
here the condition....
i need to do an banking system program...
as we know,the atm mechine appear in small box rite??
i need to do smthng like that...
it would be better if it can pop out...
but how can i do it???
by using ASCII code??
Check out http://ascii-table.com
The answer is you can't do it using ASCII code, you would have to use extended ASCII codes:
Character values from 128 to 255.
Because the actual drawn characters are system-dependent for that range, you could do a simple printout of those values, assuming you can code a for loop that prints the characters with values from 128 to 255, and choose the ones that print out nice box edges corners etc.
Alternatively, you can use ASCII and print it like:
which is a nice box, and is extremely portable also.Code:+---------------+ | | | | +---------------+
A typical example of ...cheap programming practices.Code:... goto johny_walker_red_label; johny_walker_blue_label: exit(-149$); johny_walker_red_label : exit( -22$);
Looking at what he is talking about, he is probably talking about GUI boxes, 'popping out'
Then again, I maybe wrong