enum db_func{
GET_PROCESS_INFO,
GET_ERROR_INFO
};
void dbFuncInit(void){
int i;
for (i = 0; i < MAX_FUNC_NUM; i++)
dbFuncMember[i] = NULL;
DBFUNC(GET_PROCESS_INFO, get_process_info);
DBFUNC(GET_ERROR_INFO, get_error_info);
}
int runDBFunc(db_func){
int returnVal;
printf("\n DB와 연결을 설정합니다. \n");
/* get_xxx_info() 함수를 할당하고 실행*/
returnVal = (*dbFuncMember[db_func])(); <<---------------여기서 db_func형식이름을 사용할수없다는게 왜그런거냐?
/*작업 수행 후 DB disconnect 작업 실행*/
printf("DB와 연결을 해제합니다\n\n");
return returnVal;
}
int main(){
dbFuncInit();
runDBFunc(GET_PROCESS_INFO); //or 0
runDBFunc(GET_ERROR_INFO); //or 1
}
글쎄 왜 그럴까 궁금해지네