![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
捡来的C++
文章平均质量分 62
foxqoo
这个作者很懒,什么都没留下…
展开
-
lvalue & const
<br />一个对象是被命名的存储区域或者被指向一块存储区域(an object is a named or pointed to region of storage);一个lvalue是一个指向对象的表达式(an lvalue is an expression referring to an object ).<br /> <br />重要的一句话就是“another way to determine whether an expression is an lvalue is to ask "can I转载 2010-07-02 07:57:00 · 305 阅读 · 0 评论 -
c++ 数据范围
<br />int (unsignedint)<br />__int8 (unsigned__int8)<br />__int16 (unsigned__int16)<br />__int32 (unsigned__int32)<br />__int64 (unsigned__int64)<br />short (unsignedshort)<br />long (unsignedlong)<br />longlong (unsignedlonglong)<br />Type Name<br />Bytes原创 2010-07-13 00:19:00 · 620 阅读 · 0 评论 -
c++ , java unwind 展开过程 ,看不太懂
<br />展开代码数组按降序排列。发生异常时,操作系统将整个上下文存储在上下文记录中。然后调用异常调度逻辑,该逻辑重复执行下列步骤以查找异常处理程序。<br />使用存储在上下文记录中的当前 RIP 来搜索 RUNTIME_FUNCTION 表项,该表项描述当前函数(在链式 UNWIND_INFO 项的情况下为函数部分)。<br />如果找不到任何函数表项,则异常处理程序在叶函数中,RSP 将直接对返回指针进行寻址。将 [RSP] 处的返回指针存储在更新的上下文中,将模拟的 RSP 加 8,然后重复步骤原创 2010-07-08 12:15:00 · 681 阅读 · 0 评论 -
变参函数
<br />java <br /> <br />public ver( double .... num )<br />{<br /> double tmp = 0;<br /> for( double t : num )<br /> tmp += t;<br /> for( int i=0 ; i < num.length() ; i++) <br /> tmp -= t;<br />}<br /> <br /> <br />c++<br /原创 2010-07-07 06:17:00 · 256 阅读 · 0 评论 -
source file notice
The result of preprocessing is called a translation unit. This unit is what the compiler proper works on and what theC++ language rules describe.Names of functions, classes, templates, variables, namespaces, enumerations, and enumerators must be used consi原创 2010-07-03 10:55:00 · 330 阅读 · 0 评论 -
转:Set_New_Handler()
<br />当运算符new找不到足够大的连续内存块来为对象分配内存时将会发生什么?一个称为 new-handler的函数被调用。<br />对于new-handler的缺省动作是抛出一个异常。然而,如果我们在程序里用堆分配,至少要用“内存已用完”的信息代替 new-handler,并异常中断程序。用这个办法,在调试程序时会得到程序出错的线索。<br />通过包含NEW. H,然后以我们想装入的函数地址为参数调用set_new_handler( )函数,这样就替换了new-handler。<br />type原创 2010-07-03 03:32:00 · 454 阅读 · 0 评论 -
2010 spring OOD proj3 备忘
<br />1 , MSG Node , SYSTIME , GetLocalTime( & SYSTIME );<br /> #include<windows.h> //GetLocalTime<br />class MsgNode<br />{<br />public:<br /> LType loggerType;<br /> std::string Inf;<br /> std::string occTime;<br /> Behavior aff;<br /> std::string get原创 2010-07-03 03:01:00 · 424 阅读 · 0 评论 -
复习c++: 继承 , static, cerr , cout , clog
继承和多态1。友元是不可以被继承的:基类的友元不可以访问派生类的成员;同样,一个友元的派生类也不可以访问定义友元的类。2。除static成员外,每个派生类都保存了基类的一个副本,包括派生类不能访问的 private成员;static在整个继承层中只有一个,其访问属性跟其他成员一样。3。虚函数在本质上是语义上的完备性表现:作为基类的成员却可以能被派生类重新定义;当然也正因为如此才有了多态。4。派生类的声明不允许有继承列表。5。继承是非自反的,也就是不能从自身继承。6。Constructors and the转载 2010-07-05 02:00:00 · 527 阅读 · 0 评论 -
destructor 中的 异常
<br />When an exception is thrown for a class object with a destructor, the destructor for the temporary object thrown is not called until control passes out of the catch block.<br /> <br />(1) C++中析构函数的执行不应该抛出异常; <br />(2) 假如析构函数中抛出了异常,那么你的系统将变得非常危险,也许很长时转载 2010-07-05 01:31:00 · 590 阅读 · 0 评论 -
exit and ~destructor
<br />今天在 c++ programming language 上看到这样描述<br /> <br />If a program is terminated using the standard library function exit() , the destructors for constructed static objects are called. However, if the program is terminated using the standard library func原创 2010-07-04 10:28:00 · 453 阅读 · 0 评论 -
指向成员的指针
<br />C++中指向成员的指针<br /> 一个类有两种基本的成员:函数成员和数据成员。同样的,指向成员的指针也有两种:指向函数成员的指针和指向数据成员的指针。后则其实并不常用,因为类一般是不含有公共数据成员的,仅当用在继承用C写的代码时协调结构(struct)和类(class)时才会用到。<br /> 指向成员的指针是C++语法中最难以理解的构造之一,但是这也是一个C++最强大的特性。它可以让你调用一个类的函数成员而不必知道这个函数的名字。这一个非常敏捷的调用工具。同样的,你也可以通过使用指向数据原创 2010-07-26 00:51:00 · 471 阅读 · 0 评论