2021年1月26日

程序3-13p128

摘要: #include <iostream>using namespace std;class A{public: A() { cout<<"default"<<endl; } A(A&a) { cout<<"copy"<<endl; }};class B{ A a;};int main(){ B b1, 阅读全文

posted @ 2021-01-26 16:35 流水一 阅读(186) 评论(0) 推荐(0)

2021年1月19日

程序2-3p75

摘要: #include<iostream>#include<string>using namespace std;int main(){ Student ss; int y,m,d; string name_; cout<<"请输入学生的姓名和生日,生日以\“年 月 日\”的次序输入:"; cin>>na 阅读全文

posted @ 2021-01-19 17:41 流水一 阅读(62) 评论(0) 推荐(0)

2021年1月18日

程序1-9p53

摘要: #include<iostream>#include<string.h>using namespace std;int main(){ string str; if(str.empty()) cout<<"str is NULL."<<",length="<<str.length()<<endl; 阅读全文

posted @ 2021-01-18 17:09 流水一 阅读(56) 评论(0) 推荐(0)

2021年1月10日

例1-6

摘要: #include<iostream>using namespace std;void SwapValue(int a,int b){ int tmp; tmp = a; a = b; b=tmp; cout<<"在 Swap Value()函数中:\t\ta="<<a<<",b="<<b<<endl 阅读全文

posted @ 2021-01-10 16:20 流水一 阅读(79) 评论(0) 推荐(0)

2020年12月28日

例1-4 p39

摘要: #include<iostream>using namespace std;int main(){ int oneInt =1; int & ref=oneInt; const int &refc=oneInt; ref=2; cout<<"oneInt="<<oneInt<<","<<"ref=" 阅读全文

posted @ 2020-12-28 12:48 流水一 阅读(51) 评论(0) 推荐(0)

2020年12月20日

例1-3

摘要: #include<iostream>using namespace std;void func(int a=11, int b=22,int c=33){ cout<<"a="<<a<<",b="<<b<<",c="<<c<<endl;}int main(){ func(); func(55); f 阅读全文

posted @ 2020-12-20 12:19 流水一 阅读(44) 评论(0) 推荐(0)

2020年12月17日

c++程序例1--2

摘要: #include <iostream>using namespace std;int main(){ int a= 10; const int *p=&a; const int ca=30; int *q; cout<<"a的地址为: \t"<<&a<<"\ta的值为: \t"<<a<<endl; 阅读全文

posted @ 2020-12-17 15:53 流水一 阅读(102) 评论(0) 推荐(0)

2020年12月11日

c++程序设计学习例1-1

摘要: #include<iostream>#include<string>using namespace std;int main(){int oneInt1, oneInt2;char strArray[20];string str;double oneDouble;char oneChar='a';c 阅读全文

posted @ 2020-12-11 23:46 流水一 阅读(97) 评论(0) 推荐(0)

导航