CINT and Function Pointers

Sean Kelly (kelly@physics.ucla.edu)
Thu, 25 Jun 1998 14:46:56 -0700 (PDT)


Hi Rooters

the below code compiles and generates the expected output
using g++.

1
1
1
1

when interpreted by root it generates the following output

root [0] .L foo.C
root [1] main()

97
97
1
1

My question is can CINT not deal with arrays of function pointers or is
there an error in my code ?

thanks in advance

Sean Kelly

#include <stdio.h>

// prototypes

inline int aCut0(float pLcl);
inline int aCut1(float pLcl);

main (){
typedef int (*MCUT)(float);
MCUT aCut[] = {aCut0, aCut1};
printf("%i\n",aCut[0](0.0));
printf("%i\n",aCut[1](0.34));
printf("%i\n",aCut0(0.0));
printf("%i\n",aCut1(0.34));
}
inline int aCut0(float pLcl) { return (pLcl > -0.020 && pLcl < 0.020);}
inline int aCut1(float pLcl) { return (pLcl > 0.329 && pLcl < 0.369);}