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 30 31 32 33 34
| #include "stdio.h" #include "string.h" struct Students{ char Name[20]; double ID; } ; void happy(struct Students *sd); int main() { struct Students sd1; struct Students sd2; strcpy(sd1.Name, "Pyhton"); sd1.ID=1; strcpy(sd2.Name, "C"); sd2.ID=2; happy(&sd1); happy(&sd2); } void happy(struct Students *sd) { printf("(%s)ID:%0.lf",sd->Name,sd->ID); printf("\n"); }
|