[語法] struct中的宣告

看板C_and_CPP (C/C++)作者 (漫天紅筆的大紙)時間16年前 (2009/06/04 10:12), 編輯推噓3(301)
留言4則, 3人參與, 最新討論串1/1
請教高手們 static struct super_operation s_ops ={ .statfs = samele_statfus, .drop_inode = generic_delete_indoe, }; 中 .statfs 的"."是什麼意思呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 98.244.105.68

06/04 10:14, , 1F
member variable, 如同 s_ops.statfs = sample_statfus;
06/04 10:14, 1F

06/04 12:12, , 2F
這是GCC 的擴充可直接定位struct 內的欄位
06/04 12:12, 2F

06/04 13:17, , 3F
這不是 GCC 的擴充,而是 C99 的標準
06/04 13:17, 3F

06/04 16:15, , 4F
是喔~我一直以為GCC才有
06/04 16:15, 4F
文章代碼(AID): #1A9osaTI (C_and_CPP)
文章代碼(AID): #1A9osaTI (C_and_CPP)