#import<Foundation/Foundation.h>
@interface Dog:NSObject{
@public
int rount;
}
-(void)talk;
@end
@implementation Dog
-(void)talk{
NSLog(@"旺");
}
@end
int main(){
Dog* p=[Dog new];
p->rount=1;
int a=p->rount;
for (; a<10; a++) {
NSLog(@"黄狗");
[p talk];
}
return 0;
} |
|