I would to know if t's possible in to initialise struct on the fly for function call like in c++ :
struct point {
int x;
int y;
};
some_function(new point(x,y));
Thx :)
Yes. You can use compound literals, introduced in C99.
some_function((struct pint) {5, 10});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With