function pointers - whats wrong ???
Sven Hilscher
Sven at rufus.central.de
Thu Feb 6 15:02:00 CET 1997
hello gpc users,
I tryed to use the famous function pointers, but I can't compile this
stuff. I tryed the example from info files - the same sh...
Look:
program zap(output);
type
proc_ptr = ^ procedure (integer);
var
pvar : proc_ptr;
procedure write_int(i: integer);
begin
writeln ('Integer: ',i:1);
end;
begin
(* PVAR points to function WRITE_IT *)
pvar := &write_int;
(* Dereferencing a function pointer calls the function *)
pvar^(12345);
end.
Output from gpc:
fupotest.pas(16) Error: to few arguments to function `Write_int'
fupotest.pas(16) Error: invalid lvalue in unary `&'
Now it's your turn ... what's wrong?
Further questions:
How I can put the stderr output in a file? I'm using DJGPP.
It's possible to speed up the standard compilation of gpc for my pentium?
What's the floating point type of gpc's complex numbers?
Anybody is using my graph unit "BGI2GRX"?
I'm working on a direct GRX20-Unit (contexts, mouse, ...) but I don't know
if it's needed by anybody else me.
___,
((__ o
,____)) V E N I
More information about the Gpc
mailing list