
编程语言
Devil_May_Cry_J
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++之try块和异常处理
异常处理: 1)throw表达式:throw引发异常条件 2)try块:try{...} catch(){...} catch(){..}模式,try块抛出异常,catch处理 3)标准库异常类 throw表达式: Sales_item item1, item2; std::cin >...原创 2013-11-25 20:57:58 · 751 阅读 · 0 评论 -
C++之类的继承和多态
#include <iostream> using namespace std; class CPeople { public: void do_Thing1(){cout<<"CPeople do_thing1!"<<endl;}; virtual void do_Thing2(){cout<<"CPeople do_thing...原创 2013-11-27 16:54:31 · 571 阅读 · 0 评论 -
C++之函数和const
void func() const: 这种类型的const必须和类对象联系在一起,即存在this指针。下面是错误的使用: int func() const //error编译无法通过 { int a = 10; return a; } int main(int argc, char *argv[]) { int a; a = func(); a = 20; cout&...原创 2013-11-26 10:30:27 · 499 阅读 · 0 评论 -
C++最大公约数和做小公倍数
#include <iostream> using namespace std; int LgYueShu(int v1, int v2) { if (v2 != 0) // we're done once v2 gets to zero return LgYueShu(v2, v1%v2); // recurse, reducing ...原创 2013-11-26 09:37:26 · 498 阅读 · 0 评论 -
C++之vector iterator 和 bitset
vector:容器 引入:#inlcue <vector> using std::vector; 特点:类模板 定义:1)vector<T> v1 //默认构造 2)vector<T> v2(v1) //拷贝构造 ...原创 2013-11-25 15:02:54 · 617 阅读 · 0 评论