自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 资源 (1)
  • 收藏
  • 关注

原创 c++复制构造函数、赋值操作符和析构函数

[code=c] 1(30).何时使用复制构造函数? 2(20).何时使用析构函数?析构函数的作用? 3(20).类何时需要定义自己的复制构造函数?何时需要定义复制操作符? 4(20).解释ifstream file="filename";的错误原因。 5(20).A item=string("789");item初始化的成功与失败分别说明了类A的构造函数的什么特点。 6(40).下面

2012-11-19 21:42:59 506

原创 顺时针矩阵

#include using namespace std; int main() { int n; cout<<"plese put in a integer: "; cin>>n; //创建一个n维矩阵,初始化0 int **a=new int*[n]; for(int k=0;k!=n;++k) a[k]=new int[n](); int m=1,nn=n*n; i

2012-09-18 15:43:16 332

转载 c++ primer习题10.6 文本查询程序

#ifndef TEXTQUERY_H #define TEXTQUERY_H #include #include #include #include #include #include using namespace std; class text_query{ public: typedef vector::size_type line_no; void read_file(ifstr

2012-09-14 22:03:54 491

转载 c++ primer 习题10.25

#include #include #include #include #include #include using namespace std; int main() { vector svec; set sset; cout<<"要读的书:"<<endl; string booka; while(cin>>booka) svec.push_back(booka); cin.

2012-09-13 23:10:59 930

原创 c++ primer 9.39 p297

#include #include #include using namespace std; int main() { string line1="We were her pride of 10 she named us:"; string line2="Benjamin, phoenix, the prodigal"; string line3="and perspicaciou

2012-09-11 22:41:43 505

转载 MFC窗口的颜色和字体的设置

1、改变对话框的底色 在对话框的类中添加一个 private : CBrush m_brush;的成员变量。在类的构造函数中添加如下代码: m_brush.CreateSolidBrush(RGB(0,0,255));     //初始化为蓝色 为对话框添加一个WM_CTLCOLOR消息响应函数,专门为控件着色的消息响应函数,代码如下: HBRUSH CSettingDlg

2012-05-24 09:18:38 574

原创 c++primer第四版习题6.12答案更正

编写一个小程序:从标准输入读入一系列string对象,寻找连续重复出现的单词。程序应该找出满足以下条件的单词的输入位置:该单词的后面紧跟着再次出现自己本身。跟踪重复次数最多的单词及其重复次数。输出重复次数的最大值,若没有单词重复则输出说明信息。例如,如果输入是: how, now now now brown cow cow 则输出应表明“now”这个单词出现了三次。

2012-05-22 22:21:12 765

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除