C语言使用指针实现逆序存放数组元素值

1,2,3,4,5,6,7,8,9,10 10,9,8,7,6,5,4,3,2,1谢谢了!
2024-12-02 05:57:48
推荐回答(1个)
回答1:

int a[10] = {1,2,3,4,5,6,7,8,9,10};
int *p_a = a + 9;
int i = 0;
for(i = 0; i < 10; 1++)
{
printf("%d,",*p);

p --;

}