Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!cs.utexas.edu!uunet!mcvax!hp4nl!kunivv1!atcmpe!leo From: leo@atcmp.nl (Leo Willems) Newsgroups: comp.lang.c++ Subject: sizeof in class declaration Keywords: sizeof declaration Message-ID: <533@atcmpe.atcmp.nl> Date: 14 Jul 89 20:17:13 GMT Organization: AT Computing, Nijmegen, The Netherlands Lines: 24 This is a question regarding sizeof in a class declaration. I use the sizeof operator inside a class declaration: class p{ int i; p p_in_p; // this is illegal, size of p not yet known public: p(){ i = sizeof(p); } // is this legal ?? int z; }; This example does compile with -our- compiler. But is it legal to take the size of an object in the objects declaration? Thanks. Leo Willems Internet: leo@atcmp.nl AT Computing UUCP: mcvax!hp4nl!kunivv1!atcmpe!leo P. O. Box 1428 6501 BK Nijmegen The Netherlands