【C】結構體指針的使用必須初始化,其餘變量定義對象時會賦0.

先說結論指針 結構體指針須要初始化   結構體指針的成員指針一樣須要初始化     結構體變量定義的時候就已經分配了內存空間,而上面兩個確沒有  struct test{ int i; struct buf *p; } aa;對象 //定義結構體aa內存 struct buf{ char data[512]; struct buf *prev; struct buf *next; } ;test
相關文章
相關標籤/搜索