1.写一个方法,调用的时候交换两个数的值
-(void) swap:(int*)a andNumber:(int*)b{ int temp = *a; *a = *b; *b = temp; }
调用:
int a = 1; int b = 2; [self swap:&a with:&b];
alunchen
1.写一个方法,调用的时候交换两个数的值 -(void) swap:(int*)a andNumber:(int*)b{ int temp = *a; *a = *b; *b = temp; } 调用: int a = 1; int b = 2; [self swap:&a with:&b];
alunchen
|