Copy struct to struct in C

For simple structures you can either use memcpy like you do, or just assign from one to the other: RTCclk = RTCclkBuffert; The compiler will create code to copy the structure for you. An important note about the copying: It’s a shallow copy, just like with memcpy. That means if you have e.g. a structure … Read more