- 博客(14)
- 收藏
- 关注
原创 线程
线程创建线程的方法1.继承Thread类,重写run()方法。 使用线程:创建子类对象+对象.start() 线程启动2.使用Runnable接口,使用静态代理模式。 创建线程:类 实现Runnable接口 重写run()方法-->真实角色类 启动线程: 1) 创建真实角色 2)创建代理角色+真实角色应用 ...
2019-05-13 10:07:14 118
原创 IO流
IO流IO流的基本概念和原理:一、概念流:流动 、流向 从一端移动到另一端 源头与目的地程序 与 文件|数组|网络连接|数据库 ,以程序为中心二、IO流分类1、流向: 输入流与输出流2、数据:字节流:二进制,可以一切文件 包括 纯文本 doc 音频、视频等等字符流:文本文件,只能处理纯文本3、功能:节点:包裹源头处理:增强功能,提供性能三、字符流与字节流 (重点) 与...
2019-04-21 11:08:06 94
原创 课程设计(大富翁)
源码:player类的定义(land.h):#pragma once#include<string>#include<vector>#include"land.h"#include"card.h"using namespace std;class land; class player{private: string n
2018-06-26 19:45:55 977 1
原创 实验7
实验7基础练习注释11-7#include <iostream>using namespace ::std;int main() {ios_base::fmtflags original_flags = cout.flags(); //保存cout参数设置 cout<< 812<<'|';cout.setf(ios_base...
2018-06-20 21:08:06 173
原创 实验六
实验六实验六1源码#include<iostream>using namespace std;class chip{ protected: int m; int n; double result; public: chip(int a,int b,int c=0):m(a),n(b)...
2018-06-04 19:15:06 122
原创 文件读写
文件读写创建文件• #include <fstream> // 包含头文件•ofstream outFile(“clients.dat”,ios::out|ios::binary); //创建文件– clients.dat” 要创建的文件的名字 • ios:out 输出到文件, 删除原有内容 • ios::app 输出到文件, 保留原有内容,总是在尾部添加 ...
2018-05-27 15:18:13 105
原创 流操纵算子
输入输出相关的类与输入输出操作相关的类istream是用于输入的流类,cin就是该类的对象。ostream是用于输出的流类,cout就是该类的对象。ifstream是用于从文件读取数据的类。ofstream是用于向文件写入数据的类。iostream是既能用于输入,又能用于输出的类。fstream 是既能从文件读取数据,又能向文件写入数据的类。判断输入流结束int x...
2018-05-25 21:59:05 1049 1
原创 实验五
实验五ex3.cpp源码:#include <vector>#include <string>using namespace std;// 函数声明 void output1(vector<string> &); void output2(vector<string> &); int main()...
2018-05-23 14:13:11 195
原创 c++1
引用(&)引用的概念(&)格式:类型名 &引用名=变量名;int n=4;int &r=n;//r引用了n,r的类型是 int&**定义引用时一定要将其初始化成引用某个变量****初始化后,它就一直引用该变量,不会再引用别的变量了****引用只能引用变量,不能引用常量和表达式**引用作为函数的返回值该返回值可以作为左值使用;函数...
2018-05-09 12:21:34 221
原创 实验四
实验四项目一:源码:类的定义:#ifndef GRAPH_H#define GRAPH_H// 类Graph的声明 class Graph { public: Graph(char ch, int n); // 带有参数的构造函数 void draw(); // 绘制图形 private: ...
2018-04-22 18:07:25 135
原创 实验3
实验三4_11源码:#include<iostream>using namespace std;class CRectangle{ public : int w,h; int Area(){ return w*h; } void Init(int w_, int h_){...
2018-04-09 18:28:04 123 1
原创 实验二
实验二2-2源码:#include<iostream>#include<string.h>using namespace std;int main(){ char put; cout << "Menu:A(dd) D(elete) S(ort) Q(uit),Select one:" << endl; ...
2018-03-24 13:09:10 142
原创 初次面对c++
第一次实验2-4源码:#include<iostream> using namespace std;int main(){ int day; cin>>day; switch(day) { case 1: case 2: case 3: case 4:...
2018-03-12 19:40:16 154
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人