예제 #1
0
int main(int argc, const char * argv[]) {
    People *p = new People();
    p->sayHello();
    delete p;
    
    return 0;
}
예제 #2
0
int main(int argc, const char * argv[]) {
    // insert code here...
    People *p =new People();
    p->sayHello();
    delete p;
    return 0;
}
예제 #3
0
파일: main.c 프로젝트: xiang12835/CLearn
int main() {
    People *p = PeopleInit(ObjectCreate(People),20);
    p->sayHello();
    ObjectDelete(p);

    return 0;
}
예제 #4
0
int main(int argc, const char * argv[]) {
    // insert code here...
    People *p =new People( );
    p->sayHello();
//    std::cout << "Hello, World!\n";
    delete p;
    return 0;
}
예제 #5
0
파일: main.cpp 프로젝트: whatc/xcode
int main(int argc, const char * argv[]) {
    
    //  用命名空间方式来访问类
    //  jikexueyuan:命名空间
    //  jikexueyuan::People *p = new jikexueyuan::People();
    
    People *p = new People();
    p->sayHello();
    
    //销毁对象
    delete p;
    
    return 0;
}
예제 #6
0
파일: main.cpp 프로젝트: whatc/xcode
int main(int argc, const char * argv[]) {
    
    //类对象
    People *p = new People();
    //类方法
    p->sayHello();
    
    //销毁对象
    delete p;
    
    //C语言的分配内存和销毁内存的关键字
    //malloc(sizi_t)
    //free(void *)
    return 0;
}
예제 #7
0
int main(int argc, const char * argv[]) {
    
    People *p = new Man(20);
    //People *p = new People(20,1);
    
    // Let father point to sun's shili.
    // Use the point to call the function with the
    // same name in father's
    p->sayHello();
    
    p->eat();
    
    
    return 0;
}
예제 #8
0
int main(int argc, const char * argv[])
{
//    People * p = new People();
//    p->sayHello();
//    delete p;
    
    People* m = new Man(20);
    m->sayHello();
    m->eat();
    
    printf("age : %d\n",m->getAge());
    
    delete m;
    
    
    std::cout << "Hello, World!\n";
    return 0;
}