 <p>The size of an empty class is not 1. It's <strong>AT LEAST</strong> 1 in a C++ system. The reason is that you need to be able for example to allocate an instance with <code>new</code> and having a non-null pointer directed at it.</p> <p>The second case instead is simply invalid C++.</p> <p>Often compiler makers take some freedom by allowing non-standard "extensions" by default and try to make you use them unconsciously (a paranoid would say to lock you in by making your code unportable to other compilers).</p>