From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3627 invoked by alias); 25 Aug 2005 23:33:22 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 3602 invoked by uid 22791); 25 Aug 2005 23:33:13 -0000 Received: from mx6.mail.ru (HELO mx6.mail.ru) (194.67.23.26) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 25 Aug 2005 23:33:13 +0000 Received: from [217.21.46.176] (port=29716 helo=[217.21.46.176]) by mx6.mail.ru with asmtp id 1E8RDa-0001BJ-00 for gcc-help@gcc.gnu.org; Fri, 26 Aug 2005 03:33:10 +0400 Message-ID: <430E7F43.8060301@mail.ru> Date: Thu, 25 Aug 2005 23:33:00 -0000 From: Alexey Sokolov Reply-To: sokolhacker@mail.ru User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050806) MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: bug? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-08/txt/msg00245.txt.bz2 Hallo! /**************************/ //example file "example.cpp" //begin #include main() { char name[1]; //1 byte(!) name[0]='1'; name[1]='2'; name[2]='3'; name[3]='4'; name[4]='\0'; cout << name << "\n"; } //end /**************************/ $g++ example.cpp $./a.out 1234 1,2,3,4 and '\0' = 5 byte! 5 byte != 1 byte (char name[1];)! But why? Forgive for English, I am simple Russian =) -- #gcc --version gcc (GCC) 3.4.2 [FreeBSD] 20040728