C语言中如何写"takes 2 integers, returns a Point_t representing these integers"函数?

How can write "takes 2 integers, returns a Point_t representing these integers" function in C programming?

typedef struct { int x; int y; } Point_t;
Point_t construct_point(int x, int y); /* takes 2 integers, 
                                          returns a Point_t representing 
                                          these integers */

这个函数怎么写?

这真的很简单:

typedef struct
{
    int x;
    int y;
} Point_t;

Point_t f(int x, int y)
{
    Point_t p = { x, y };

    return p;
}

并且(提前打败可能的评论):不,这不是返回对局部变量的引用。