上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页

2015年5月28日

auto自动类型

摘要: 1 /* auto自动类型 */ 2 3 #include 4 5 int main() 6 { 7 double db = 10.9; 8 double *pdb = &db; 9 auto num = pdb;// 通用传入接口10 std::cout <<... 阅读全文

posted @ 2015-05-28 08:59 Dragon-wuxl 阅读(168) 评论(0) 推荐(0)

2015年5月27日

new和delete

摘要: 1 /*new delete*/ 2 3 #include 4 #include 5 #include 6 7 void main() 8 { 9 int num = 10;// 栈上 10 int *p = new int;// 堆上 11 *p =... 阅读全文

posted @ 2015-05-27 16:17 Dragon-wuxl 阅读(121) 评论(0) 推荐(0)

const 说明

摘要: 1 /* const 说明 */ 2 3 void main() 4 { 5 int data = 100; 6 const int num = 100;//c++保证常量绝对不被修改 7 std::cout (&num);// 强制去掉const属性 9 *p ... 阅读全文

posted @ 2015-05-27 14:21 Dragon-wuxl 阅读(85) 评论(0) 推荐(0)

constcpp

摘要: 1 /*constCCPP*/ 2 3 // c语言 4 void main() 5 { 6 const int num =5; 7 int a[num];// 不可以 8 int *p = &num; 9 *p = 3;// c语言是弱类型语言... 阅读全文

posted @ 2015-05-27 11:14 Dragon-wuxl 阅读(89) 评论(0) 推荐(0)

左值与右值引用

摘要: 1 /*左值与右值*/ 2 3 #include 4 #include 5 6 // 左值就是可以放在赋值号左边被赋值的值,必须在内存有实体 7 // 右值就是可以放在赋值号右边取出值赋给其他变量的值 8 // 右值可以在内存也可以在寄存器 9 10 void main()... 阅读全文

posted @ 2015-05-27 09:34 Dragon-wuxl 阅读(93) 评论(0) 推荐(0)

2015年5月26日

泛型auto

摘要: 1 /*auto*/ 2 3 #include 4 5 void main() 6 { 7 auto num = 10.9; // 自动变量 自动匹配类型 8 auto numA = 10; 9 std::cout << num << numA << std::endl... 阅读全文

posted @ 2015-05-26 10:08 Dragon-wuxl 阅读(147) 评论(0) 推荐(0)

函数重载与函数默认参数

摘要: 1 /*函数重载的原理*/ 2 3 // c中 4 5 // 参数的个数参数的类型不同 顺序不同 与返回值无关 6 void go(int a) 7 { 8 std::cout << a; 9 }10 11 void go(double a)12 {13 std::cout <... 阅读全文

posted @ 2015-05-26 09:39 Dragon-wuxl 阅读(144) 评论(0) 推荐(0)

2015年5月25日

命名空间详解

摘要: 1 /*命名空间详解*/ 2 3 namespace runrunrunrun 4 { 5 int a(10); 6 char *str("gogogo"); 7 namespace run // 命名空间的嵌套 8 { 9 in... 阅读全文

posted @ 2015-05-25 22:32 Dragon-wuxl 阅读(109) 评论(0) 推荐(0)

C与CPP不同以及命名空间简介

摘要: 1 /*C,Cpp不同*/ 2 3 #include 4 void main() 5 { 6 int *p1 = null; 7 double *p2 = null; 8 p1=p2; // c语言类型检查不明确 9 }10 // c中可以编译通过 c++中不行 C... 阅读全文

posted @ 2015-05-25 21:32 Dragon-wuxl 阅读(296) 评论(0) 推荐(0)

临时文件的创建以及自动创建临时文件名和添加临时文件扩展名

摘要: 临时文件的创建: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 5 // tmpfile产生临时文件,关闭文件或者程序关闭,就会自动删除 6 // 创建临时文件 7 void main() 8 { 9 FILE *pt... 阅读全文

posted @ 2015-05-25 16:33 Dragon-wuxl 阅读(1145) 评论(2) 推荐(0)

上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页

导航