以ä¸ã®ä¾ã§ã¯ãé¢æ°ã¸ã®ãã¤ã³ã¿ã¨ãã¦func_ptrã宣è¨ãããããã¸é¢æ°my_functionã®ã¢ãã¬ã¹ãå²ãå½ã¦ã¦ãããããã¦func_ptrãéãã¦é¢æ°ãå¼ã³åºãã¦ããã #include <stdio.h> static int my_function(int a) { printf("my_function: %d\n", a); return 2 * a + 3; } int main(void) { int (*func_ptr)(int a) = my_function; /* ãããã¯ä»¥ä¸ã§ãå¯è½ */ /* int (*func_ptr)(int) = &my_function; */ int x; x = (*func_ptr)(10); /* ãããã¯ä»¥ä¸ã§ãå¯è½ */ /* x = func_ptr(10); */ printf("main: %d\n", x);
{{#tags}}- {{label}}
{{/tags}}