title: Constructor for structs in C
body: <p>Given:</p>
  
  <pre><code>struct objStruct {
      int id;
      int value;
  };
  
  typedef struct objStruct Object;
  </code></pre>
  
  <p>Is there a shortcut to allocate and initialize the object, something like a C++ constructor?<br>
  It could even be a preprocessor macro. Whatever makes the code shorter and more readable than this:</p>
  
  <pre><code>Object *newObj = malloc(sizeof(Object));
  // successful allocation test snipped
  newObj-&gt;id = id++;
  newObj-&gt;value = myValue;
  </code></pre>