- 博客(5)
- 收藏
- 关注
原创 实现子菜单复选功能并对应不同窗体标题
在doc文件中加入如下的代码即可,利用自行声明对应变量或用类向导声明相应函数void Clianxi6512Doc::OnSettitle(){ if(bSetTitle) { bSetTitle=FALSE; SetTitle(CTime::GetCurrentTime().Format("lianxi6512"));//设置窗体的标题 } else { bSetTitl
2016-03-17 17:50:06
430
原创 继承类中利用派生类访问基类保护成员
// lianxi4.2.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#includeusing namespace std;class A{protected: int a;public: A();//在用继承类时基类中必须有A()这个默认的构造函数,只需要在其中初始化数据成员即可 A(int x);};A::A(int x){
2016-03-10 21:14:35
1226
原创 使用友元函数实现用外部函数修改类内的私有数据成员
// lianxi4.1.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#includeusing namespace std;class ClassAdd{private: int x; int y;public: friend int ModifyMember(ClassAdd &Ca,int a,int b);//定义友元函数时注
2016-03-09 21:04:00
3378
转载 C++中的seekg函数
seekg 对输入文件定位,有两个参数: * 第一个:表示偏移量,可正可负,正表示向后,负表示向前 * 第二个:偏移的基地址myFile.seekg( sizeof(Record), ios::beg );//其中Record为一个类,ios::beg为输入流的开始;myFile.read( (char*)&record,sizeof(record) );//函数原型istre
2016-03-08 19:48:28
2625
转载 c++,对txt文件进行读取显示
#include "stdafx.h"#include#include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ifstream in("w.txt"); string filename; string line; if(in)
2016-03-08 09:07:05
961
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人