Re: drawing using C
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Tue, 02 May 2006 23:45:05 GMT
"liorm" <liorm@xxxxxx> writes:
I need to write a short program which gets a few parameters and draws a
diagram in the text file. Basically what I need is a guidance on how I
put stream indicator to the required position. What I mean is that I
need to draw a character at the (x,y) coordinate. But how do I bring
the indicator to this position. I tried to use fsetpos(fp, y*80+x) but
then when I draw the character by fputs("_",fp) I see it on the first
line with y*80+x offset instead of y-th line with x offset. I'd
appriciate any idea. Thanks.
It's possible on many systems to control the cursor position (for
example, jump to (0, 0), write some characters, jump to (10, 20),
write some more characters, etc.). There's just no way to do this in
standard C. If you want this kind of control, as used by a
full-screen text editor, look for "curses", "ncurses", or something
similar.
But if you want the diagram in a text file rather than on a display,
this doesn't help you. For that, see the other replies in this
thread.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- drawing using C
- From: liorm
- drawing using C
- Prev by Date: Re: Question about "enums"
- Next by Date: Re: Programmer Research
- Previous by thread: Re: drawing using C
- Next by thread: Re: memory allocation query
- Index(es):
Relevant Pages
|