From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b807da453e88972,start X-Google-Attributes: gid103376,public From: "Barry L. Dorough" Subject: Function Pointers Date: 1998/04/13 Message-ID: <353257CC.211B84EE@phaseiv.com>#1/1 X-Deja-AN: 343660028 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Renaissance Internet Services Newsgroups: comp.lang.ada Date: 1998-04-13T00:00:00+00:00 List-Id: Is there any way to implement function pointers in Ada? Below is a sample C program using function pointers. How can I do this in Ada? Thanks in advance, Barry Dorough #include double Add( double x, double y ); double Subtract( double x, double y ); double Combine( double p, double q, double (*fcn)(double r, double s) ); int main() { double w = 20.0; double x = 5.0; double y = Combine( w, x, Add ); double z = Combine( w, x, Subtract ); cout << w << " " << x << " " << y << " " << z << endl; return 0; } double Add( double x, double y ) { return x+y; } double Subtract( double x, double y ) { return x-y; } double Combine( double p, double q, double (*fcn)(double r, double s) ) { double a = 10.0 + p; return fcn( a, q ); }