gpt4 book ai didi

c - 指针和 struct c

转载 作者:太空宇宙 更新时间:2023-11-04 07:55:29 27 4
gpt4 key购买 nike

<分区>

这是我的结构

typedef struct lists
{
struct reasonslist* alist;
}lists;

struct reasonslist
{
char* proreasons;
int numr;
char* conreasons;
int numc;
};

主要

int main(void)
{
char str[100] = "";
lists dielema = {0};
printf("write your reason: ");
getchar();
fgets(str, 100, stdin);
dielema.alist->proreasons= &str;

我尝试将 str 与我的结构进行比较是行不通的*(dielema.alist->proreasons) = str 它也不起作用

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com