is it possible to do this?
I work on DOS and i use turbo-c.
i have a function say
void abc(void);
i have a second function say
void xyz( p1, p2, ..);
{
abc();
}
my question is, how can i pass the function abc as a parameter to the function xyz. is it possible to do this?
more specifically, xyz is a function to which i pass four parameters. 1. database name, 2. index name, 3. index key, 4. index mode. THe index key has to be calculated for each record so that function xyz adds the key at the appropriate place in the index file. If i simply call the function abc() from within the function xyz, everything works fine. but then function xyz is tied to abc. if i have to use a different key, i have to write a new function, the only difference being the function abc(). if i can pass the function as a parameter the function xyz could be more generic.
any c guru could please help. thanks
subra if you find this useful let me know at vksubra@icenet.net
I work on DOS and i use turbo-c.
i have a function say
void abc(void);
i have a second function say
void xyz( p1, p2, ..);
{
abc();
}
my question is, how can i pass the function abc as a parameter to the function xyz. is it possible to do this?
more specifically, xyz is a function to which i pass four parameters. 1. database name, 2. index name, 3. index key, 4. index mode. THe index key has to be calculated for each record so that function xyz adds the key at the appropriate place in the index file. If i simply call the function abc() from within the function xyz, everything works fine. but then function xyz is tied to abc. if i have to use a different key, i have to write a new function, the only difference being the function abc(). if i can pass the function as a parameter the function xyz could be more generic.
any c guru could please help. thanks
subra if you find this useful let me know at vksubra@icenet.net