#include <stdio.h>


struct EMPRECORD {

char name[20];

int age;

float salary;

char hobby[3][20];

};



int main()

{


char word[30] = "asdasdasdasdasdas";

printf("%s, \n", word);


// 1. 선언과 동시에 초기화;

struct EMPRECORD employee = { "Jhonghyun", 20, 1231, "baketball" };

printf("이름 : %s \n", employee.name);

printf("나이 : %d \n", employee.age);

printf("연봉 : %f \n", employee.salary);

printf("취미 : %s \n", employee.hobby);


// 2. 선언 이후 초기화;

struct EMPRECORD employee2;

//employee2.name = "asdasdas";  //이건 불가능!!

strcpy(employee2.name, "홍길동");

employee2.age = 20;

employee2.salary = 312312;

strcpy(employee2.hobby, "잠자기");

printf("이름 : %s \n", employee2.name);

printf("나이 : %d \n", employee2.age);

printf("연봉 : %f \n", employee2.salary);

printf("취미 : %s \n", employee2.hobby);


//3. 구조 선언과 동시에 초기화

struct EMPRECORD {

char name[20];

int age;

float salary;

char hobby[3][20];

}employee3 = { "이름asdad", 40, 13123, "pppppppp" };


printf("이름 : %s \n", employee3.name);

printf("나이 : %d \n", employee3.age);

printf("연봉 : %f \n", employee3.salary);

printf("취미 : %s \n", employee3.hobby);


}


교수님이 올려주신 그대로인데, 교수님이 하실 땐 정상적으로 작동했는데 왜 내거로 하니까 strcpy가 정의돼있지 않다고 그러지..? 도와줘 ㅠ