[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: pointers to functions

On Sun, 25 Jun 2000, deepak yadav wrote:

+ > ( a() , b() , c() );
+ >the problem is -- i want to vary the number and ordering of these functions within that statement at run time.
+ one solution for this which comes to my mind is making array of pointers to functions. and changing the binding of pointers to function at runtime.
+ so if a[] is an array of pointers , i could write
+   ( *a[0] ) () ,  ( *a[1] ) () , ( *a[2] ) () );
+ and i just need to change these pointers to execute different functions with different ordering and change the number by leaving array pointers NULL which are not required.

And this needs to be done in C? If language is not a problem, give C++ 
a try. BTW, what is the specific thing that needs to be done?