explain assign a structure variable to another structure variable
Answers
Answered by
0
Answer:
memcpy (dest_struct, source_struct, sizeof (*dest_struct)); dest_struct->strptr = strdup(source_struct->strptr); This will copy the entire contents of the structure, then deep-copy the string, effectively giving a separate string to each structure.
Similar questions