随笔 - 193
文章 - 0
评论 - 5
阅读 -
22133
02 2012 档案
Oracle中使用游标的两个例子
摘要:Example 6-41 Using CURRENT OF to Update the Latest Row Fetched From a Cursor DECLARE my_emp_id NUMBER(6); my_job_id VARCHAR2(10); my_sal NUMBER(8,2);
阅读全文
C++中struct成员的偏移量的计算
摘要:C++中,计算struct成员的偏移量,有如下三种方法可用。 //假设有定义如下: struct st_test { int a; char b; double c; }; //现想要求 b 相对于 st_test 的偏移地址。 // 1 ): 常用的方法 (size_t)&(((st_test *
阅读全文
含虚函数的struct在其构造中要谨慎使用memset函数对数据成员清零
摘要:假设有定义如下 struct st { int a; char b[20]; st(){memset(this, 0, sizeof(st));} virtual ~st(){} }; st *p = NULL; p = new st; delete p; //p!=NULL, 但程序抛出异常,提示
阅读全文
C++学习摘要之四:虚函数和多态
摘要:【原文: http://c.chinaitlab.com/cc/basic/200905/784976.html 】 多态性与前面提到的数据封装和继承性共同构成了面向对象程序设计的三个重要机制。 1.静态联编与动态联编 由于函数重载的存在,当程序中出现调用同名函数时,编译器会根据函数的参数类型、个数
阅读全文