![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
DreamLike_zzg
这个作者很懒,什么都没留下…
展开
-
五子棋(C++面向对象实现)
代码链接:https://download.csdn.net/download/dreamlike_zzg/10948075VS2017,控制台输出字符显示棋盘。共定义的6个class,即棋子类(Chess)、棋盘类(ChessBoard)、棋手类(Player)、裁判类(Judge)、显示类(Displayer)、游戏类(Game)。有人机对弈人人对弈两种模式,时间原因AI下棋落子是随机的。...原创 2019-02-02 13:36:43 · 10389 阅读 · 8 评论 -
C++ 二维vector初始化、resize()
二维vector初始化1.定义时就设置大小、初值vector<vector<int> > v(2, vector<int>(4,1));//2行*4列,初始化为1 2.先定义vector,再设置大小、赋值vector<vector<int> > v(2); //2行// v.resize(2);for(int ...原创 2019-02-03 19:45:11 · 16792 阅读 · 0 评论 -
C/C++中关于时间的函数 time()
转 C/C++中关于时间的函数 time() 2017年11月05日 11:53:16 宁静而至远 阅读数:2284 函数:time(time...转载 2019-02-03 21:13:33 · 2242 阅读 · 0 评论 -
C++ 拷贝构造函数和赋值构造函数
.C++ 拷贝构造函数和赋值构造函数 一下内容从不同网站摘录而来 在C++中复制...转载 2019-02-16 10:40:03 · 1098 阅读 · 0 评论 -
const 与 指针
1.指向常量的指针(*P是常量,P不是常量) const int a = 5; const int b = 6; int c = 7;// int *pa = &a; //不能将const int* 赋值给int*,否则可以通过*pa修改a const int* p ; //const 约束了 指针所指向的对象 的常量性,并未约束指针本身 // int c...原创 2019-02-12 19:05:49 · 145 阅读 · 0 评论 -
引用
引用一定程度弥补了指针的“野蛮”。引用只有声明,没有定义,一旦绑定不能再换(外号不能再给别人)。只有具体类型的对象才能被引用。 int temp=1; int temp2=2; int &b = temp; b=temp2; //temp2的值赋给b cout<<b<<endl; //output:2cons...原创 2019-02-13 19:12:17 · 200 阅读 · 0 评论 -
freopen函数
C/C++ 输入输出到文件freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);freopen("out.txt","a+",stdout);原创 2019-03-15 10:26:33 · 380 阅读 · 1 评论