#ifndef
#define
class A {
public:
A();
A(int a);
const int i;
};

#endif
#include "A.h"
A::A():i(2){//1.常成员变量所在类的每个构造函数,通过初始化列表中进行初始化成员变量

}

A::A(int a):i(3) {

}
#include "A.h"
#include <iostream>
using namespace std;

void fun() {
A A1;
cout << "A1.i = " << A1.i << endl;
A A2(3);
cout << "A1.i = " << A1.i << endl;
cout << "A2.i = " << A2.i << endl;

}


int main() {
fun();

return 0;
}