## 函数作为一种数据类型
package main
/*
#include <stdio.h>
typedef int (*FuncType_C)(int,int); //c语言 函数类型
int test_C(int a,int b){
return a+b;
}
FuncType_C f_C = test_C;
void test2_C(){
int c = f_C(1,2);
printf("%d\n",c);
}
*/
import "C"
import "fmt"
type FuncType func (int, int) int //go语言 函数类型
func test(a int, b int) int{
return a+b;
}
func main() {
var f FuncType
f = test
c := f(1,2)
fmt.Println(c)
C.test2_C()
}