Skip to content

例子中有错误 #2

@crazylovecat

Description

@crazylovecat

Hi,【3. 预备知识(C语言)- 结构体 - 如何使用结构体】中的例子中有个变量使用错了:
`
printf(" name = %s\n",pst->name);
printf(" name = %s\n",(*pst)->name); // 这里应该是 (*pst).name

// pst -> name 等价于 (*pst).name ,
// 而(*pst).name 又等价于 ss.name
// 所以 pst -> name 等价于 ss.name
return 0;`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions