So why are you using a C++ compiler (check your error messages) if you're posting on the C board.
Code:
#include <stdio.h>
int first_fit(int a, int b){return a+b;}
int best_fit(int a, int b){return a+b;}
int worst_fit(int a, int b){return a+b;}
typedef int (*fnptr)(int,int);
int main( int argc, char *argv[] ) {
int (*part_algo_array[3])(int, int);
fnptr array2[3];
part_algo_array[0] = first_fit;
part_algo_array[1] = best_fit;
part_algo_array[2] = worst_fit;
array2[0] = first_fit;
array2[1] = best_fit;
array2[2] = worst_fit;
return 0;
}
When it comes to function pointers, you can make life a lot easier with a suitable typedef.