Questions tagged «microchip»

7
将struct复制到C中的struct
我想将一个相同的结构复制到另一个结构中,以后再与第一个结构进行比较。问题是当我这样做时,我的编译器会警告我!我应该用其他方式还是做错了呢? 在头文件中: extern struct RTCclk { uint8_t second; uint8_t minute; uint8_t hour; uint8_t mday; uint8_t month; uint8_t year; } RTCclk; 在C文件中: struct RTCclk RTCclk; struct RTCclk RTCclkBuffert; void FunctionDO(void) { ... // Some Code /* Copy first struct values into the second one */ memcpy(&RTCclk, &RTCclkBuffert, sizeof RTCclk); }
74 c  struct  copy  microchip 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.