Mail Archives: djgpp/1996/04/16/11:37:41
Xref: | news2.mv.net comp.os.msdos.djgpp:2772
|
From: | mad AT telepac DOT pt
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | DJGPP 1.12 M4
|
Date: | Tue, 16 Apr 1996 12:51:21 GMT
|
Organization: | telepac
|
Lines: | 73
|
Message-ID: | <4l0c7r$34l@vivaldi.telepac.pt>
|
Reply-To: | mad AT telepac-pt
|
NNTP-Posting-Host: | lis4_p8.telepac.pt
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I was asking some help to DJ Delorie and here is my latest question to
him (it wasn't answered until now). I'm now giving my first steps in
C and i'm now starting to use DJGPP which i find great yet complicated
to use but i'm willing to try.
> Try the newsgroup, mailing list, or mail archives for graphics drivers. Try to
> get a VESA driver for your card, and use the default VESA driver.
Thx. I was trying to avoid going to a newsgroup but i'll do has you
say. Just would like to know if there is a specific driver for my S3
801/805 card.
> DJGPP is ANSI compliant.
Well then i need an explanation about this. I have a Book called
"Programming in ANSI C" written by Stephen G. Kochan from 1994 and it
has a topic called "Pointers to functions" and i'll quote some of the
text:
" [...] To declare a variable fn_pointer to be o type "pointer to
function that returns an int and takes no argument" the declaration
int (*fn_pointer) (void);
can be written. The parentheses around *fn_pointer are required, as
otherwise the C compiler would treat preceding statement as the
declaration of a function called fn_pointer that returns a pointer to
int (because the functional call operator () has higher precedence
than the pointer indirection operator * ).
In order to set our function pointer pointing to a specific function,
we simply assign the name of the function to it. So if lookup were a
function that returned an int and that took no arguments, the
statement
fn_pointer=lookup;
would store a pointer to this function inside the function pointer
variable fn_pointer. Writing a function name without subsequent set of
parentheses is treated in an analogous way to writing an array name
without a subscript. The C compiler automatically produces a pointer
to a specific function. An Ampersand is permitted in front of the
function name, but it's not required.
If the lookup function has not been previously defined in the program,
it will be necessary to declare the function before the above
assignment can be made. So a statement such has
int lookup (void);
would be needed before a pointer to this function could be assigned to
the variable fn_pointer. We can call the function that is indirectly
referenced through a pointer variable by applying the function call
operator to the pointer, listing any arguments to the function inside
the parentheses. For example,
entry=fn_pointer ();
would call the function pointed to by fn_pointer, storing the return
value inside the variable entry. [...]"
I've tried to do this but i was unable to compile.Does DJGPP support
this ?
Thx in advance and sorry to waste your time.
- Raw text -