CINT and Function Pointers

From: Sean Kelly (kelly@physics.ucla.edu)
Date: Thu Jun 25 1998 - 23:46:56 MEST


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);}



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:34 MET