用c实现面向对象(oopc)

时间:2013-02-02 02:22:06
【文件属性】:
文件名称:用c实现面向对象(oopc)
文件大小:61KB
文件格式:ZIP
更新时间:2013-02-02 02:22:06
c oo oopc 面向对象 系统和全面地介绍用c的方式实现面向对象编程。包括继承,虚函数,异常等处理 来自法国的牛人,采用宏的方式实现,形式如下: void constMethodDecl(print) { printf("name:\t%s\n", this->m.name); } BASEOBJECT_IMPLEMENTATION methodName(print) ENDOF_IMPLEMENTATION initClassDecl() {} /* class ctor, required */ dtorDecl() /* object dtor, required */ { free((void*)this->m.name); this->m.name = NULL; } t_person classMethodDecl_(*const new) char const name[] __ { t_person *const this = person.alloc(); person.init(this, name); return this; } void methodDecl_(init) char const name[] __ { this->m.name = strdup(name); } void methodDecl_(copy) t_person const*const per __ { person._person(this); person.init(this, per->m.name); } CLASS_IMPLEMENTATION methodName(new), methodName(init), methodName(copy) ENDOF_IMPLEMENTATION
【文件预览】:
oopc
----ooc.c(3KB)
----oodebug.c(8KB)
----ooexception.h(666B)
----ooc99.h(17KB)
----examples()
--------education.h(801B)
--------person.H(535B)
--------test_manager.C(1KB)
--------education.c(1KB)
--------person.c(1KB)
--------example.h(2KB)
--------g_memBlock.h(1KB)
--------education.H(582B)
--------example.H(1KB)
--------example.c(2KB)
--------g_array.c(2KB)
--------compile.sh(133B)
--------manager.C(528B)
--------education.C(433B)
--------manager.H(709B)
--------array.h(670B)
--------test_array.c(3KB)
--------test_protection.c(1KB)
--------memBlock.h(746B)
--------memBlock.c(719B)
--------test_example.C(2KB)
--------employee.H(614B)
--------employee.c(2KB)
--------test_manager.c(2KB)
--------manager.h(1KB)
--------compile-cpp.sh(62B)
--------person.C(413B)
--------test_exception.c(999B)
--------manager.c(2KB)
--------compile_tests.sh(613B)
--------array.c(658B)
--------g_array.h(1KB)
--------employee.h(928B)
--------employee.C(475B)
--------test_example.c(2KB)
--------g_memBlock.c(2KB)
--------person.h(820B)
----ooc.h(17KB)
----oodebug.h(3KB)
----oopc.html(97KB)
----exception.h(3KB)
----exception.c(2KB)
----objectModel.c(4KB)

网友评论

  • 可以吧,用来初学者左借鉴