33,311
社区成员
发帖
与我相关
我的任务
分享
CFile file=CFile(TEXT("a.txt"),CFile::modeCreate| CFile::modeWrite);
TCHAR * content=TEXT("xxx");
file.Write(content,sizeof(TCHAR)*lstrlen(content));
file.Close();
#include "stdafx.h"
#include<iostream>
using namespace std;
class Person
{
public:
Person(int age, float height):m_age(age),m_height(height)
{
cout<<"constructor invoked"<<endl;
}
Person( const Person & m)
{
m_age= m.m_age;
m_height=m.m_height;
cout<<"copy constructor invoked"<<endl;
}
private:
int m_age;
float m_height;
};
int main()
{
//Person peter(12,3.56);
//Person steven = peter;
Person steven = Person(13,1.45);
system("pause");
}