struct
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #include <stdio.h> #include <stdlib.h> #include <string.h> unsigned short int MAXIMUM = 1; typedef struct _PRIVACY { char name[20]; int age; char adress[100]; } Privacy; int main (void) { Privacy* man = calloc (MAXIMUM, sizeof (struct _PRIVACY)); strcpy (man->name, "Stive"); man->age = 23; strcpy (man->adress, "America"); printf("name : %s\n", man->name); printf("age : %d\n", man->age); printf("adress : %s\n", man->adress); free (man); return 0; } | cs |
0 개의 댓글:
댓글 쓰기