摘要:
//C++单例模式:指一个类只生成一个对象#includeusingnamespacestd;classA{public: staticA* getA(); staticA* a; intb =0; voidfunAdd(){ b++; coutfunAdd(); if(i ==4) { (A::getA())->funClear(); } } return0;} 阅读全文
posted @ 2013-07-29 19:01
蓬莱仙羽
阅读(376)
评论(0)
推荐(0)
摘要:
Student.h:#import @interface Student : NSObject@property(nonatomic,retain) NSString * name;@property(nonatomic,assign) int age;@endStudent.m:#import "Student.h"@implementation Student//动态方法,在main函数中类alloc了之后调用,但是要手动管理内存,要手动释放-(id) initWithAge:(int)age{ if (self == [super init]) { _age = ag 阅读全文
posted @ 2013-07-29 12:34
蓬莱仙羽
阅读(541)
评论(0)
推荐(0)

浙公网安备 33010602011771号