Advertisement
bmeneguele

struct/union/struct/array

Apr 26th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. struct rtc_time {
  2.     union time {
  3.         struct full {
  4.             uint32_t full_time[8];
  5.         } full;
  6.  
  7.         struct fields {
  8.             uint32_t second;
  9.             uint32_t minute;
  10.             uint32_t hour;
  11.             uint32_t day_week;
  12.             uint32_t day_month;
  13.             uint32_t day_year;
  14.             uint32_t month;
  15.             uint32_t year;
  16.         } fields;
  17.     } time;
  18. };
  19.  
  20. int main(void)
  21. {
  22.     struct rtc_time tmm_time = {.time.full = {0, 33, 0, 7, 26, 0, 4, 2015}};
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement