从几天以来,我一直致力于更新服务器项目的代码。 发现一行我看不懂(被注释了)
首先,我得到:
int *t;
然后我得到这个(评论):
t[*t];
这个“t[*t]”是什么类型
最佳答案
类型是 int
左值。我们有两个部分:
*t // this is an int
t[ some int ] // this is standard array indexing
或者举个简单的例子:
int array[] = {1, 2, 3, 4};
int* t = array;
使用该设置:
t[*t] == t[1] == 2
或者:
t[*t] = 7;
// now array[] holds {1, 7, 3, 4}
关于c++ - 诠释 *吨;这个 t[*t] - 类型定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27347698/