好好学习c++
文章平均质量分 77
jaxiinofea
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
除虫一则--关于new []/delete[]的误用
今天看《c陷阱与缺陷》,中间有一段像下面一样,我就敲进去玩玩#include #include using namespace std;int main(){ char* s1 = "s1"; char* s2 = "s2"; char* r = static_cast(malloc(strlen(s1) + strlen(s2) + 1)); if (!r原创 2004-09-20 21:25:00 · 854 阅读 · 0 评论 -
变量初始化
变量初始化有三种方式: 方式 example-------------------------------------------------1.调用default ctor T t;2.调用对应参数类型的ctor T t(parameter);3.调用c原创 2004-10-08 17:50:00 · 962 阅读 · 0 评论 -
cast
今天在abp上看到篇关于cast的文章,有些问题我还没注意到。=1=// cast_a.cpp#include using namespace std;class Interface{ int member;};class Base {};class Derived : public Interface, public Base {};int main(){ Base*原创 2004-11-11 16:28:00 · 880 阅读 · 0 评论 -
从const_cast引出的一个问题
看到const_cast,于是想做一件正常的事:用const_cast移除某对象的常数性,修改之。于是像下面这样写: const int i = 10; //int& ri = const_cast(i); // error! int& ri = const_cast(i); ri = 0; cout cout原创 2006-05-24 13:44:00 · 2038 阅读 · 0 评论 -
vs2005抱怨找不着libc.lib的问题
链接HGE的tutorial,遇到一个链接错误,vs抱怨说找不着libc.lib(看到这个名字还以为和libc.a有什么联系呢,我以为到UNIX了)。google一下,libc.lib原来是被遗弃的可怜家伙。MSDN Labs: Whats New in Visual C++ 2005 Quote: The single-thre原创 2006-12-04 01:54:00 · 17483 阅读 · 4 评论
分享