03 2020 档案

摘要:1 #include<iostream> 2 #include<windows.h> 3 #include<time.h> 4 #include<conio.h> 5 #define H 22 6 #define W 22 7 using namespace std; 8 9 class chess 阅读全文
posted @ 2020-03-30 16:35 江雨牧 阅读(708) 评论(0) 推荐(0)
摘要:getch():所在头文件:conio.h函数用途:从控制台读取一个字符,但不显示在屏幕上函数原型:int getch(void)返回值:读取的字符例如:char ch;或int ch;getch();或ch=getch();用getch();会等待你按下任意键,再继续执行下面的语句;用ch=get 阅读全文
posted @ 2020-03-30 13:44 江雨牧 阅读(1422) 评论(0) 推荐(0)
摘要:1 class Sales_data 2 { 3 public: 4 string isbn() const {return bookNo;} 5 private: 6 string bookNo; 7 } Sales_data total;//total是该类的一个对象 total.isbn(); 阅读全文
posted @ 2020-03-19 23:37 江雨牧 阅读(138) 评论(0) 推荐(0)
摘要:本篇转自http://c.biancheng.net/view/422.html 程序运行时常会碰到一些异常情况,例如: 做除法的时候除数为 0; 用户输入年龄时输入了一个负数; 用 new 运算符动态分配空间时,空间不够导致无法分配; 访问数组元素时,下标越界;打开文件读取时,文件不存在。 这些异 阅读全文
posted @ 2020-03-01 15:18 江雨牧 阅读(601) 评论(0) 推荐(0)
摘要:char str[6]="hello"; 当编译器遇到这句时,会把str数组中从第一个元素把hello\0 逐个填入。C语言中规定数组名代表数组所在内存位置的首地址,也是 str[0]的地址,即str = &str[0]; char str[6]="hello"; cout<<str<<" "<<s 阅读全文
posted @ 2020-03-01 11:04 江雨牧 阅读(1503) 评论(0) 推荐(0)