定義和分配
執行新增兩個雙精度數的塊,分配給變數 addition
:
double (^addition)(double, double) = ^double(double first, double second){
return first + second;
};
隨後可以像這樣呼叫塊:
double result = addition(1.0, 2.0); // result == 3.0
執行新增兩個雙精度數的塊,分配給變數 addition
:
double (^addition)(double, double) = ^double(double first, double second){
return first + second;
};
隨後可以像這樣呼叫塊:
double result = addition(1.0, 2.0); // result == 3.0