/*给你修改了下,希望对你有帮助!*/
#include
int main(void)
{
int Buf1[64] = {0};
int Buf2[32] = {0};
for(int i = 0; i < 64; ++i) //先给Buf1赋值;
Buf1[i] = i + 1;
for(int i = 32,j = 0; iBuf2[j]=Buf1[i];
for(int i = 0; i < 32; i++) //输出Buf2;
printf("%d ",Buf2[i]);
printf("\n");
return 0;
}
int j应该放在外面,要不每次执行都会重新初始化 j,导致每次只给buf2【0】赋值