也就是说函数返回值为指向结构体指针数组的指针
#include<stdio.h>
struct s
{
};
//ptarrpt是指向具有2个指针元素的数组的指针类型
typedef struct s* (*ptarrpt)[2];
ptarrpt f1()
{
static struct s* ptarr[2];
return &ptarr;
}
struct s* (*f2())[2]
{
static struct s* ptarr[2];
return &ptarr;
}
int main()
{
return 0;
}
struct s
{
};
//ptarrpt是指向具有2个指针元素的数组的指针类型
typedef struct s* (*ptarrpt)[2];
ptarrpt f1()
{
static struct s* ptarr[2];
return &ptarr;
}
struct s* (*f2())[2]
{
static struct s* ptarr[2];
return &ptarr;
}
int main()
{
return 0;
}
温馨提示:答案为网友推荐,仅供参考
第1个回答 2019-12-12
正确的写法是:
struct node{....}*p;
struct node *a(){...;return p;}
这是完全合法的。
struct node{....}*p;
struct node *a(){...;return p;}
这是完全合法的。