请问下面两段输出结果一样的代码在内存层面上有什么不同,有点搞不清。
代码1:
1 #include
2 using namespace std;
3 struct Test{
4 int a;
5 Test(int a){
6 Test::a=a;
7 }
8 };
9 int main(){
10 Test t(100);
11 cout<<t.a<<endl;
12 }
代码2:
1 #include
2 using namespace std;
3 struct Test{
4 int a;
5 Test(int a){
6 this->a=a;
7 }
8 };
9 int main(){
10 Test t(100);
11 cout<<t.a<<endl;
12 }