포인터 도와주세요 ㅠㅠㅠㅠ
채련
2023.04.01
//문제가 arr[0]=6,arr[1]=5 이렇게 반대로 입력하는문제인데요 ....
#include stdio.h
int main(){
int arr[]={1,2,3,4,5,6},i=0;
int *temp1=&arr[0];
int *temp2=&arr[5];
int *temp3;
for(i=0;i2;i++){
*temp3=*temp1;
*temp1=*temp2;
*temp2 = *temp3;
temp1++;
temp2--;
}
for(i=0;i6;i++){
printf(%d\n,arr[i]);
}
}
소스를 짰는데 오류창 뜨는데요 뭐가 문제인지 잘 모르겠어요 ㅠㅠ