Notice
Recent Posts
Recent Comments
Creative Code
pointer5.c(함수포인터) 본문
#include <stdio.h>
int add(int a, int b)
{
return a + b;
}
int substract(int a, int b)
{
return a-b;
}
int main(void)
{
int(*fp)(int, int);
fp = &add;
int re = (*fp)(4,3);
printf("re : %d\n",re);
fp = &substract;
re = (*fp)(4,3);
printf("re : %d\n",re);
return 0;
}
'C Programming' 카테고리의 다른 글
lotto2.c(로또 번호 추첨) (0) | 2023.08.03 |
---|---|
pointer6.c(void 포인터) (0) | 2023.08.02 |
pointer4.c(이중포인터) (0) | 2023.08.02 |
pointer3.c(char형 포인터참조) (0) | 2023.08.02 |
pointer3.c(int형 포인터 참조) (1) | 2023.08.02 |