淡水求咸

博客园已经停止更新,请移步 http://lovecjh.com/

导航

2012年2月15日

程序员几个应该去的国内网站

摘要: 1、CSDNhttp://www.csdn.net/推荐理由:IT新闻 论坛2、51CTOhttp://www.51cto.com/推荐理由:博客3.博客园http://www.cnblogs.com/推荐:没有被污染的程序员之家(但C/C++方面的文章很少)4.VC知识库http://www.vckbase.com/推荐理由:C++之家5.程序员联合开发网http://www.pudn.com/推荐理由:下载源代码6.皮皮书屋http://www.ppurl.com/推荐理由:计算机电子书免费下载这是我常去的几个网站,希望大家将好的网站进行分享哈 阅读全文

posted @ 2012-02-15 16:32 深圳彦祖 阅读(3464) 评论(9) 推荐(3) 编辑

2012年2月10日

C++之函数重载

摘要: 重载函数(1)定义:将一组功能非常相近的函数定义为重载函数。(2)一组重载函数是以参数类型或参数个数加以区别的,只有返回值不同不是一组重载函数,将会产生编译错误。(3)编译器调用重载函数的规#include <stdio.h>void ShowMessage(const char* Text,int Type);void ShowMessage(const char* Text,unsigned int Type);int main(){ unsigned char i=0; ShowMessage("hello",i); return 0;}void Show 阅读全文

posted @ 2012-02-10 11:19 深圳彦祖 阅读(718) 评论(0) 推荐(0) 编辑

2012年1月5日

C++关键字mutable

摘要: Mutable(1)mutable的意思是“可变的,易变的”,跟C++中的const是反义词。(2)在C++中,mutable也是为了突破const的限制而设置的。被mutable修饰的变量,将永远处于可变的状态,即使在一个const函数中实例说明:#include <iostream>using namespace std;class TestMutable{public: TestMutable(){i=0;} int Output() const { return i++; //error C2166: l-value specifies const ob... 阅读全文

posted @ 2012-01-05 21:26 深圳彦祖 阅读(4377) 评论(0) 推荐(1) 编辑

C++关键字explicit

摘要: explicit的中文解译是:详尽的;清楚的;明确的。那么explicit在C++中是什么意思呢?Explicit(显示的)(1)explicit可以禁止“单参数构造函数”被用于自动类型转换,有效的防止了构造函数的隐式转换带来的错误。(2)explicit只对构造函数起作用,用来抑制隐式转换。(3)所有的单参数的构造函数都必须是explicit的,以避免后台的类型转换。用实例说明上面两点:#include <iostream>using namespace std;class People{public: People(int age){} People(string name). 阅读全文

posted @ 2012-01-05 21:08 深圳彦祖 阅读(1500) 评论(0) 推荐(0) 编辑

2012年1月3日

求助大师们:C++与C#中new用法的异同?

摘要: 先看下面new在C++与C#中实例化的不同://C++Student类class Student{public: string name;};//实例化Student类Student student1;Student *student2=new Student();// C#Student类public class Student{ public string Name { get{return name;} set{name=value;} } private string name;}//实例化Student类Student stu... 阅读全文

posted @ 2012-01-03 18:25 深圳彦祖 阅读(1102) 评论(1) 推荐(0) 编辑