Given:
struct objStruct { int id; int value; }; typedef struct objStruct Object;
Is there a shortcut to allocate and initialize the ob
In C it is possible to declare an inline function with the same name as structure:
struct my { int a; }; inline struct my* my(int* a) { return (struct my*)(a); } //somewhere in code int num = 123; struct my *sample = my(&num); //somewhere in code
It looks pretty similar to C++ ctors.