您的位置:首页 > 移动开发 > Objective-C

iOS开发之 Objective-C语言基础 :代码块

2016-02-22 15:54 609 查看
#import <Foundation/Foundation.h>

typedef void (^SayHello)();

int (^max)(int a,int b);

typedef void (^SayHello)();

int main(int argc,
const char * argv[]) {

@autoreleasepool {





SayHello sh=^(){

printf(" programing is very fun ……\n");



};

sh();

max =^(int a ,int b){

return a>b?a:b;

};

NSLog(@"\n the max is :%d\n",max(7,1));









}

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: