上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
摘要: /****Lession1.h****/extern bool a;extern int b;extern float c;extern double d;extern unsigned int e;extern long f;extern unsigned long g;extern char h;extern long double i; /****Lession1.cpp****/#include "stdafx.h"#include "Lession1.h"bool a;int b;float c;double d;unsigned int e; 阅读全文
posted @ 2011-10-25 13:44 韩冬冬 阅读(291) 评论(0) 推荐(0)
摘要: #include "stdafx.h"#include <iostream>#include <vector>using namespace std;int _tmain(int argc, _TCHAR* argv[]){ /****数组用法****/ int iar[6] = {-12,-2,0,8,5,4}; vector<int> ivec(10,3); vector<int> ivec1(iar+1,iar+4); vector<int> ivec2(ivec1); vector<int>:: 阅读全文
posted @ 2011-10-25 13:43 韩冬冬 阅读(536) 评论(0) 推荐(0)
摘要: #include "stdafx.h"#include <iostream>#include <bitset>using namespace std;int _tmain(int argc, _TCHAR* argv[]){ bitset<32> bitvec(8); bool flag = bitvec.any();//判断是否存在某位或者多位为1,有则返回true bool flag1 = bitvec.none();//判断是否所有的位都是0,是则返回true bool flag2 = bitvec.test(3);//测试第4位是 阅读全文
posted @ 2011-10-25 13:42 韩冬冬 阅读(477) 评论(0) 推荐(1)
摘要: char cal1[] = {'C','+','+'};//维数是3 char cal2[] = "c++";//维数是4 //char cal3[] = cal1;//不能用一个数组初始化另一个数组 //char &cal4[] = {'C','+','+'};//c++不允许数组引用----------------------------------------------------------string *ps = new string("Hello 阅读全文
posted @ 2011-10-25 13:35 韩冬冬 阅读(205) 评论(0) 推荐(0)
摘要: dynamic_cast:通常在父类与子类之间转化时使用,转化的类型和对象都是类对象,不能应用于c++内置类型static_cast:一般的类型转换,但不能将一个const对象转型为non-const对象(只有const_cast能做到)。const_cast:将一个const对象转型为non-const对象;reinterpret_cast:通常对于操作数的位模式执行一个比较低层次的重新解释。 阅读全文
posted @ 2011-10-25 13:29 韩冬冬 阅读(173) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 下一页