<p>I want to initialize a struct element, split in declaration and initialization. This is what I have:</p>

<pre><code>typedef struct MY_TYPE {
  bool flag;
  short int value;
  double stuff;
} MY_TYPE;

void function(void) {
  MY_TYPE a;
  ...
  a = { true, 15, 0.123 }
}
</code></pre>

<p>Is this the way to declare and initialize a local variable of <code>MY_TYPE</code> in accordance with C programming language standards (C89, C90, C99, C11, etc.)? Or is there anything better or at least working?</p>

<p><strong>Update</strong> I ended up having a static initialization element where I set every subelement according to my needs.</p>

```
```
void function(void) {
  MY_TYPE a;
  a.flag = true;
  a.value = 15;
  a.stuff = 0.123;
}
```
```