//People.cpp文件
#include "people.h"
People::People()
{
m_sName = "xiaoming";
m_iAge = 20;
}
void People::OutPut()
{
cout << m_sName;
}
//People.h文件
#ifndef PEOPLE_H
#define PEOPLE_H
#include <iostream>
using namespace std;
class People
{
public:
People();
void OutPut();
public:
string m_sName;
int m_iAge;
};
#endif // PEOPLE_H</span>
//main文件
#include <iostream>
#include "people.h"
using namespace std;
int main()
{
People* p = new People();
p->OutPut();
return 0;
}</span>
<span style="font-size:24px;">
</span>