From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19671 invoked by alias); 8 Apr 2010 09:01:31 -0000 Received: (qmail 19534 invoked by uid 22791); 8 Apr 2010 09:01:30 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SARE_MSGID_LONG45,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Apr 2010 09:01:26 +0000 Received: by gya1 with SMTP id 1so976390gya.20 for ; Thu, 08 Apr 2010 02:01:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.155.17 with HTTP; Thu, 8 Apr 2010 02:01:24 -0700 (PDT) Date: Thu, 08 Apr 2010 09:01:00 -0000 Received: by 10.151.59.18 with SMTP id m18mr1490147ybk.194.1270717284325; Thu, 08 Apr 2010 02:01:24 -0700 (PDT) Message-ID: Subject: sizeof empty class From: ranjith kumar To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00046.txt.bz2 Hi, 1) What is the size of an an empty class? On my machine it is showing 1. What is stored at that 1 byte memory? 2) will sizeof() function ever return zero? 3)How constructor/destructor are called when an object is created? Any hidden virables will be crerated by the compiler inside the class? 4) Why destructor of derived class is not called when we delete a baseclass pointer which is pointing to derived class? Thansk in advance.