Re: drawing using C



"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.
.



Relevant Pages

  • Re: define and assignment
    ... I've come to believe that you are correct and the diagram is ... Hm, does EnvDraw do this for other kinds of objects, e. ... I found a similar example in the Common Lisp HyperSpec: ... same thing'' if that thing is a character or number. ...
    (comp.lang.scheme)
  • Re: Varying cell height
    ... The '-' in your diagram seems to place the horizontal line half-way up ... the character height in the adjoining cell, which doesn't sound like a ...
    (comp.text.tex)
  • Re: Varying cell height
    ... The '-' in your diagram seems to place the horizontal line half-way up ... the character height in the adjoining cell, which doesn't sound like a ...
    (comp.text.tex)