이중 포인터 사용 질문드려요 ㅜ
큰돌찬
2023.04.01
이중 포인터를 사용해서 이 프로그램에서 발생하는 오류를 찾으라는데.. ㅠㅠ 아직 공부하지 못한 부분이라 모르겠어요 ㅠㅠ코딩은 이렇게 되고 이중 포인터를 사용해서 수정하고올리라는데 .. 도와주세요 유유
#includestdio.h
#includestdlib.h
#includestring.h
void made(char*);
void reverse(char*, int);
int size, len;
int main(){
char *ip = NULL;
made(ip);
reverse(ip, len);
printf(문자열 출력 : %s\n, ip);
free(ip);
return 0 ;
}
void made(char *ip){
printf(문자열의 길이를 입력: );
scanf(%d, &size);
ip = (char *)malloc((size + 1)*sizeof(char));
printf(받을 문자열의 내용 입력 );
scanf(%s, ip);
len = strlen(ip);
}
void reverse(char *ip, int len){
char temp, *ep = NULL;
ep = ip + len -1;
for( ; ip ep ; ip++, ep--){
temp = *ip;
*ip = *ep;
*ep = temp;
}
}