【发布时间】:2015-11-29 18:31:10
【问题描述】:
如何检查指针是否在我的数组末尾?
这是我的代码。如果输入了d,并且指针在末尾,什么都不做;如果没有,请向右移动。
if(d == 'd')
{
if (*p != a[6]) //a[6] is the array length // this is where i need help
{
++*p;
num_mov++;
print_status(a, *p, num_mov);
}
else
print_status(a, *p, num_mov);
}
【问题讨论】:
标签: c arrays pointers indexing