
c++
sunyongjie_old_boy
努力成为拥有好习惯的普通专业程序员
展开
-
sizeof总结
本文来自优快云博客,转载出处:http://blog.youkuaiyun.com/chief1985/archive/2009/10/23/4720191.aspx以下是我自己跟据这个文章,做了一点点小的调试和修改#include "stdio.h"#include // 在默认的情况下,为了方便对结构体内元素的访问与管理:// 1.当结构体内的元素的长度都小于处理器的位数的时候,便以结构体内最长的元素为对齐单位。// 2.如果结构体内存在长度大于处理器位数的元素,就以处理器位数作为对齐单位。t转载 2010-12-28 10:06:00 · 569 阅读 · 0 评论 -
GNU的C++代码书写规范
<br />C++ Standard Library Style Guidelines DRAFT 1999-02-26<br />-------------------------------------<br />This library is written to appropriate C++ coding standards. As such,<br />it is intended to precede the recommendations of the GNU Coding<br />S转载 2011-01-18 16:12:00 · 828 阅读 · 0 评论 -
操作符重载
http://www.cppblog.com/shongbee2/archive/2009/04/01/78554.aspx转载 2011-01-19 00:10:00 · 530 阅读 · 0 评论 -
google c++ code style
<br />http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml转载 2011-03-12 22:19:00 · 830 阅读 · 0 评论 -
exception
刘未鹏http://blog.youkuaiyun.com/pongba/archive/2007/10/08/1815742.aspx九天雁翎http://blog.youkuaiyun.com/vagrxie/archive/2009/07/03/4317423.aspx转载 2011-03-28 14:27:00 · 590 阅读 · 0 评论 -
dont return local address
#include #include // 编译器真是相当友好啊warning C4172: returning address of local// variable or temporary 一定不要返回局部变量啊char* GetMemory(void){ char p[] = "hello world"; return p; // 这里是返回local的addres原创 2011-10-10 14:43:12 · 818 阅读 · 0 评论 -
left value. right value. reference. const reference
// 以下是我个人的理解,如有错误请告知,非常感谢你。#include #include using namespace std;string one("cute"); // non-const lvalueconst string two("fluffy"); // const lvaluestring three() // non-cons原创 2011-03-04 12:51:00 · 3391 阅读 · 0 评论