gcc컴파일 쓰는 곳에선 되는데 vs2010으로 하면 안됨 ㅎㅎ;;;
에러나는 부분임
typedef struct node {
char* question;
struct node* no;
struct node* yes;
} node;
int yes_no(char* question)
{
char answer[3];
printf("%s? (y/n): ", question);
fgets(answer, 3, stdin);
return answer[0] == 'y';
}
node* create(char* question)
{
node* n = malloc(sizeof(node)); <-------- 에러 : " void* " 형식의 값을 사용하여 "node* " 형식의 엔터티를 초기화 할 수 없습니다.
n->question = strdup(question);
n->no = NULL;
n->yes = NULL;
return n;
}
라고 나오는데 msdn 찾아보니 strdup <-- 요놈이 보안상 예전꺼라 다른거쓴다고 나오는데
아오 멘붕 으아아아아아아악~~
type casting 공부좀해라
당연히 안되지 타입 맞춰 ㅋㅋㅋ
근데 희안하게 GCC 컴파일러에서는 된다니깐? ㅎㅎ;; VS2010에서 안되는거임 ㅎㅎ;
vs요즘에 까탈 스러워 졌어 성격맞춰줘야해