1 points · by jackson_1 · 10y ago · 0 comments
typedef struct {int x; int y;} Point;
void plot(Point p);
Normally, to call this function, you have to create a Point first:
Point p = {1, 2};
plot(p);
But, with compound literals, you can declare p anonymously:
plot((Point){1, 2});
Does anyone else have neat C tricks to share?
No comments yet.