// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
struct haitao { //定义一个结构体
int a, b;
string namee01;
string namee02;
int chengFa() {
return a*b;
}
};
int main()
{
haitao t1{ 13,75,"xuhaitao","hunk xu" };
cout << t1.a <<" "<<t1.b<<" "<<t1.namee01<<" "<<t1.namee02<< endl;
system("pause");
return 0;
}
上述代码打印结果:
QQ技术交流群:386476712
FR:海涛高软(hunk Xu)