#include
STRCPY (stu_a.ffull_name, "hexuhui"); stu_a.ge = 1;
STRCPY (stu_b.full_name, "candy"); stu_b.age = 20; stu_b.gender = 2; / * Displays the value before the exchange data * / printf ("Data IN Stu_a: / N");
Printf ("% s / n", stu_a.full_name); Printf ("% D / N", STU_A.AGE); Printf ("% d / n", stu_a.gender); Printf ("Data IN Stu_b: / N ");
Printf ("% s / n", stu_b.ffull_name); Printf ("% d / n", stu_b.age); Printf ("% d / n", stu_b.gender); / * calls swap_struct_data function, remove STU_A And the address of the STU_B, the incoming function is converted into a character pointer, and SIZEOF (STRUCT STUFF) is the size of the structure * / swap_struct_data ((char *) & stu_a, (char *) & stu_b, sizeof (struct stuff)); / * Displays the value after the exchange data * / printf ("Data IN Stu_A After Call Function: / N");
Printf ("% s / n", stu_a.ffull_name); Printf ("% D / N", STU_A.AGE); Printf ("% D / N", stu_a.gender; Printf ("Data IN Stu_b After Call Function: / n ");
Printf ("% s / n", stu_b.ffull_name); Printf ("% d / n", stu_b.age); Printf ("% d / n", stu_b.gen);}