delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/04/23:32:27

Date: Tue, 4 Mar 1997 23:28:07 -0500 (EST)
From: Michael Phelps <morphine AT hops DOT cs DOT jhu DOT edu>
To: "W. L. Estes" <wlestes AT hamlet DOT uncg DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: gettextinfo(), cprintf() question
In-Reply-To: <Pine.GSO.3.93.970304152406.8608A-100000@euler.uncg.edu>
Message-ID: <Pine.GSO.3.95.970304232524.4697B-100000@hops.cs.jhu.edu>
MIME-Version: 1.0

On Tue, 4 Mar 1997, W. L. Estes wrote:

> When i attempt to compile the following:
> 
> #include <conio.h>
> 
> int main()
> {
>   struct text_info {
>     unsigned char winleft;
>     unsigned char wintop;
>     unsigned char winright;
>     unsigned char winbottom;
>     unsigned char attribute;
>     unsigned char normattr;
>     unsigned char currmode;
>     unsigned char screenheight;
>     unsigned char screenwidth;
>     unsigned char curx;
>     unsigned char cury;
> } ;
> text_info *foo;

Unless you are using C++, you need to declare this as
	struct text_info *foo;

> gettextinfo (*foo);

My guess is that you want to call function gettextinfo like so:
	gettextinfo(foo);

This way, you pass the pointer, so that the function can pass information
back using a statement such as "foo->screenheight = 25;"

> cprintf ("%u", foo.screenheight);
> return 0;
> }
> 
> I am told that text_info and foo are undeclared. what should i be doing?
> 
> and what about the call to cprintf? is that gonna work, if not what should
> that be? i just wanna print the screenheight.
> 
> thanks in advance,
> --will
> 
> 
> 
> 


						---Michael Phelps
						   morphine AT cs DOT jhu DOT edu


                               CH3
                               |
                               N
                             / |
                     ______/   |
                    /      \   CH2
             _____/         \__|__      
           //     \\        /  |  \\     
         //        \\______/___CH2 \\  
          \        /       \       /
           \______/         \_____/
          / ------ \       /      \
        OH           \   /         OH
                       O
 
                   Morphine



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019