#在C中定义结构名称

#在C中定义结构名称,c,C,有没有办法在.h文件中写入类似的内容 #define _struct 'profile' int output(_struct list[],int n) { for (int i=0; i<n; i++) { printf("%s\n"list[i].name); } } #定义结构“profile” int输出(_结构列表[],int n) { 对于(inti=0;i显然,您正试图在C中实现类似于but的目标 虽然在C中不可能实

有没有办法在.h文件中写入类似的内容

#define _struct 'profile'


int output(_struct list[],int n)
{
    for (int i=0; i<n; i++) {
        printf("%s\n"list[i].name);
    }
}
#定义结构“profile”
int输出(_结构列表[],int n)
{

对于(inti=0;i显然,您正试图在C中实现类似于but的目标


虽然在C中不可能实现这种行为,但请看一看,哪一个正在尝试使用宏来实现类似的功能。

我不知道您为什么想要这样做。