int a = 3, b = 4;
decltype(a) c = a;
decltype((b)) d = a;
++c;
++d;
?
a为int型,程序结束时值为4。
b为int型,程序结束时值为4。
c为int型,程序结束时值为4。
d为int &型,程序结束时值为4。
/*************************************************************************
> File Name: ex2.36.cpp
> Author:
> Mail:
> Created Time: Mon 22 Jan 2024 03:19:35 PM CST
************************************************************************/
#include<iostream>
using namespace std;
int main(){
int a = 3, b = 4;
decltype(a) c = a;
decltype((b)) d = a;
++c;
++d;
cout<<"a = "<<a<<endl;
cout<<"b = "<<b<<endl;
cout<<"c = "<<c<<endl;
cout<<"d = "<<d<<endl;
return 0;
}