注册 登录
编程论坛 C语言论坛

结构体里嵌套一个结构体数组指针

数据总线 发布于 2020-07-02 17:15, 10632 次点击
typedef struct
{
    unsigned char x;
    unsigned char y;
    unsigned char mode;
    char  *str;
}seat_s;

typedef struct
{
    seat_s *seat[3];
    unsigned char a;      
    unsigned char b;
}MENU_s;

MENU_s  Top_Mode;   
请教一下怎样访问seat_s这个结构体里边的每个成员,及初始化???

52 回复
#52
lin51616782020-07-03 20:10
and so on, and so forth. There are all kinds of ways to get an invalid pointer value in C. My favourite has got to be the guy who tried to "save" his objects by writing their addresses to a file. Strangely, when he read back those pointer values during a different run of the program, they didn't point to his objects any more. Fancy, that.

But that's just what wild means to me. Since it's not a normative term, it means whatever the person who spoke or wrote it meant it to mean. Ask him or her.

那么多一段原文你怎么漏了
作者原意 野指针不是规范的术语
所以描述野指针 他会尽量准确无歧义
所以其他人使用这个词可能用于表达和作者不同的含义 具体含义自行Ask him or her

他根本没表达不能使用野指针这个词的意思
并且 他的描述和我的描述没什么矛盾

搞得好像只有你上过stackoverflow ?
#53
数据总线2020-07-03 22:10
一石击起千层浪
12