RE:mail not yet answered

From: Masaharu Goto (MXJ02154@niftyserve.or.jp)
Date: Fri Jul 10 1998 - 12:50:00 MEST


Sean,

Sorry for delay in response.

About array of pointer to function in CINT,

Your code includes a couple of cint syntax limitations. With following
modification, your code works fine.

Masaharu Goto

--------------------------------------------------------------
#include <stdio.h>

// prototypes

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

typedef int (*MCUT)(float);
main (){
  //typedef int (*MCUT)(float); no typedef in function scope
  MCUT aCut[] = {aCut0, aCut1};
  printf("%i\n",(*aCut[0])(0.0)); // (* ) needed for array of func ptr
  printf("%i\n",(*aCut[1])(0.34));// (* ) needed for array of func ptr  
  //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