function_ptr.c
C•マスター
Explorer
C
初級10
中級10
上級10
エキスパート5
マスター5
function_ptr.c
linked_list.c
bit_ops.c
signal.c
mem_pool.c
C++40
C#40
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript40
function_ptr.c
Click to focus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
typedef int (*op_func)(int, int);↵
struct op {↵
char name[8];↵
op_func func;↵
};↵
int add(int a, int b) { return a + b; }↵
int mul(int a, int b) { return a * b; }↵
struct op ops[] = {↵
{"add", add},↵
{"mul", mul}↵
};↵
int exec(int idx, int a, int b) {↵
return ops[idx].func(a, b);↵
}
0WPM•0%•0:00•0/285(0%)|Ln 1, Col 1
UTF-8•C