monoteen

1030_3-12_자료구조

Oct 29th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. struct employee {
  5.     char name[10];
  6.     int year;
  7.     int pay;
  8. };
  9.  
  10. int main(void)
  11. {
  12.     struct employee Lee;
  13.     struct employee *Sptr = &Lee;
  14.     strcpy(Sptr->name, "이순신");
  15.     Sptr->year = 2005;
  16.     Sptr->pay = 2900;
  17.  
  18.     printf("\n 이름 : %s", Sptr->name);
  19.     printf("\n 입사 : %d", Sptr->year);
  20.     printf("\n 연봉 : %d\n\n", Sptr->pay);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment