You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
一个常量引用可以引用一个不同类型的对象,通过生成temp对象完成:
double a=2.1;
const int &b=a;
这个是可以的:
double a=2.1;
const int temp=a;
const int &b=temp;
b其实绑定在temp上,那为什么指针不可以呢?
double a=2.1;
const int *b=&a;
不可以这样吗?
double a=2.1;
const int temp=a;
const int *b=&temp;
The text was updated successfully, but these errors were encountered:
一个常量引用可以引用一个不同类型的对象,通过生成temp对象完成:
double a=2.1;
const int &b=a;
这个是可以的:
double a=2.1;
const int temp=a;
const int &b=temp;
b其实绑定在temp上,那为什么指针不可以呢?
double a=2.1;
const int *b=&a;
不可以这样吗?
double a=2.1;
const int temp=a;
const int *b=&temp;
The text was updated successfully, but these errors were encountered: