C语言对结构体何时用> , 何时用.

从网上查到资料,以作为备忘。

当结构体是一个指针时要引用结构体的成员就用-> 而如果不是指针就用. 如: struct msg_st { int a; }; struct msg_st msg; struct msg_st *ms; msg.a = 10; ms->a = 20;
原文地址:https://www.cnblogs.com/gaojian/p/2678655.html