对
可以打出来类型。下面这个b2类型不一样。b和b3一样。
const auto& b = *a;
const auto& t = typeid(decltype(b));
printf("%s, %s\n", t.name(), t.raw_name());
const auto b2 = *a;
const auto& t2 = typeid(decltype(b2));
printf("%s, %s\n", t2.name(), t2.raw_name());
const int(&b3)[M][N] = *a;
const auto& t3 = typeid(decltype(b3));
printf("%s, %s\n", t3.name(), t3.raw_name());
【 在 paramita555 的大作中提到: 】
:
: C++可以,用引用就行
: int (*a)[M][N] = (int (*)[M][N])p;
: ...................
--
FROM 221.218.160.*