#define offsetof(type, f) ((size_t) \ ((char *)&((type *)0)->f - (char *)(type *)0))
這種實現不是 100% 的可移植; 某些編譯器可能會合法地拒絕接受。
參考資料: [ISO, Sec. 7.1.6]; [Rationale, Sec. 3.5.4.2]; [H&S, Sec. 11.1 pp. 292-3]。