今天看到这个问题大部分都是用for循环解决的,想问一下怎么用while解决
{
int a[10];
int i = 0;
while (i < 10)
{
i++;
a[i] = i;
}
while (i < 10)
{
i++;
printf("%d\n", a[i]);
}
}
提示我引发异常
Run-Time Check Failure #2 - Stack around the variable 'a' was corrupted.
求解答