title: How to assign a C struct inline?
body: <pre><code>typedef struct {
      int hour;
      int min;
      int sec;
  } counter_t;
  </code></pre>
  
  <p>And in the code, I'd like to initialize instances of this struct without explicitly initializing each member variable. That is, I'd like to do something like:</p>
  
  <pre><code>counter_t counter;
  counter = {10,30,47}; //doesn't work
  </code></pre>
  
  <p>for 10:30:47</p>
  
  <p>rather than</p>
  
  <pre><code>counter.hour = 10;
  counter.min = 30;
  counter.sec = 47;
  </code></pre>
  
  <p>Don't recall syntax for this, and didn't immediately find a way to do this from Googling.</p>
  
  <p>Thanks!</p>