왜 이런 걸까요...ㅜㅜ오류 5개 뜨네요
한뎃집
디시 올려봅니다..ㅜㅜ오류5개 뜨는데요....잘 모르겠어서....ㅜㅜ
질문 내용 :
#include stdio.h
#include string.h
#define false 0
#define true 1
typedef struct {
enum tag_field {female,male} sex;
union {
int children;
int beard;
}u;
}sex_type;
typedef struct
{
char name[10];
int age;
float salary;
sex_type sex_info;
}human_being;
int humansequal(humanbeing person1, humanbeing person2)
{
/* 만일 personal과 person2가 동일인이면 true를 반환하고 그렇지
않으면 false를 반환한다. */
if (strcmp(person1.name, person2.name))
return false;
if (person1.age != person2.age)
return false;
if (person1.salary != person2.salary)
return false;
return true;
}
int main()
{
human_being person1, person2;
strcmp(person1.name,minyoung);
person1.age = 23;
person1.salary = 2500;
strcmp(person2.name,sunhee);
person2.age = 23;
person2.salary = 2400;
person1.sex_info.sex = male;
person1.sex_info.u.beard = false;
person2.sex_info.sex = female;
person2.sex_info.u.children = 4;
return 0;
}
-
걸때 2024-01-06
무한 감사드립니다...ㅜㅜ
-
샤르 2024-01-06
human_being과
humanBeing은 다릅니다. -
두빛나래 2024-01-06
int humansEqual(humanBeing person1, humanBeing person2)
여기서보시면
인자로 humanBeing을 받는데
이것에 대한 정보는 소스 어디에서도 찾아볼수없습니다.
본레 뜻이 human_being을 가지고 처리하려고 하시는것 같으시니 고치시면 될듯합니다.