有没有办法找出指针在数组中的位置?数组指针算术问题
可以说,我们已经做到了这一点:
int nNums[10] = {'11','51','23', ... }; // Some random sequence
int* pInt = &nNums[4]; // Some index in the sequence.
...
pInt++; // Assuming we have lost track of the index by this stage.
...
有没有办法来确定哪些元素索引数组pInt
的是“指点”无须重新走阵?
对不起,按照目前的措辞,这没有意义的我。 – 2010-03-31 17:06:04
轻微重写。 – Konrad 2010-03-31 17:08:45
int * pInt = nNums [4];'需要'int * pInt =&nNums [4];'。 – 2010-03-31 17:13:13