C语言函数中如何返回一个结构体类型

2025-03-26 08:07:05
推荐回答(1个)
回答1:

如:
struct ststst{
    int a;
    int b;
    char c;
}

struct ststst f1()
{
    /*写好代码*/
    struct ststst ss={3,5,'J'};
    return ss;
}