[Assorted-commits] SF.net SVN: assorted:[1300] sandbox/trunk/src/cc/sizeofstatics.cc
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-03-17 17:24:41
|
Revision: 1300 http://assorted.svn.sourceforge.net/assorted/?rev=1300&view=rev Author: yangzhang Date: 2009-03-17 17:24:21 +0000 (Tue, 17 Mar 2009) Log Message: ----------- added demo of sizeof static members Added Paths: ----------- sandbox/trunk/src/cc/sizeofstatics.cc Added: sandbox/trunk/src/cc/sizeofstatics.cc =================================================================== --- sandbox/trunk/src/cc/sizeofstatics.cc (rev 0) +++ sandbox/trunk/src/cc/sizeofstatics.cc 2009-03-17 17:24:21 UTC (rev 1300) @@ -0,0 +1,5 @@ +// Demo that static members don't count toward the per-struct sizeof. +#include <iostream> +using namespace std; +struct s { static int x; int y; }; +int main() { cout << sizeof(s) << endl; return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |