Cor*_*sif 5 c struct function on-the-fly
我想知道是否有可能像在c ++中那样在函数调用中初始化struct:
struct point {
int x;
int y;
};
some_function(new point(x,y));
Run Code Online (Sandbox Code Playgroud)
谢谢 :)
是.您可以使用C99中引入的复合文字.
some_function((struct pint) {5, 10});
Run Code Online (Sandbox Code Playgroud)