malloc, free. 오류가 나는 이유를 알고싶습니다..
자올
2023.04.01
질문 제목 : 질문 내용 : #include stdio.h
#include stdlib.h
int main()
{
char *asdf;
asdf=(char *)malloc(20);
asdf=qwerqwer;
printf(%s,asdf);
free(asdf);
asdf=null;
return 0;
}free를 안넣으면 에러가 안나는데
free를 넣으면 에러가생기네요
왜인지 아시는분 알려주시면 감사하겠습니다..