This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15240] sizeof() doesn't work on struct fields
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 May 2004 03:40:55 -0000
- Subject: [Bug c/15240] sizeof() doesn't work on struct fields
- References: <20040501113223.15240.d.yu.bolkhovityanov@inp.nsk.su>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-05-03 03:40 -------
One possible answer is that contrary to Java, in C and C++ you cannot
access members of _types_ using type.member. If anything, then this should
be type::member (in C++), which would fail in your case since the
member is non-static, though. The dot-operator can only be used to
access members of _variables_, not _types_.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15240