From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17810 invoked by alias); 20 May 2003 13:23:56 -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 17644 invoked from network); 20 May 2003 13:23:52 -0000 Received: from unknown (HELO smtp-relay-3.sea.adobe.com) (192.150.22.10) by sources.redhat.com with SMTP; 20 May 2003 13:23:52 -0000 Received: from inner-relay-3.corp.adobe.com (inner-relay-3 [153.32.251.51]) by smtp-relay-3.sea.adobe.com (8.12.9/8.12.9) with ESMTP id h4KDNZhq024175 for ; Tue, 20 May 2003 06:23:40 -0700 (PDT) Received: from iplan-mn.corp.adobe.com (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-3.corp.adobe.com (8.12.9/8.12.9) with ESMTP id h4KDNUnl024292 for ; Tue, 20 May 2003 06:23:31 -0700 (PDT) Received: from mn-eljaypc.adobe.com ([130.248.188.120]) by iplan-mn.corp.adobe.com (Netscape Messaging Server 4.15 mn Jul 11 2001 16:32:57) with ESMTP id HF6T7500.TFS; Tue, 20 May 2003 08:23:29 -0500 Message-Id: <4.3.2.7.2.20030520081825.00b4f4a8@iplan-mn.corp.adobe.com> X-Sender: eljay@iplan-mn.corp.adobe.com Date: Tue, 20 May 2003 13:23:00 -0000 To: "Ajay Bansal" , From: Eljay Love-Jensen Subject: Re: Problem with fread In-Reply-To: <2B721C6525F0D411B1E900B0D0226BDD02AAE0AC@mohmsg01.ad.infos ys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2003-05/txt/msg00153.txt.bz2 Hi Ajay, fread does not append a '\0' (null character) at the end of a buffer. Regarding your test_fread.cpp attachment... You shouldn't use #include , you should use #include . You shouldn't use #include , you should use #include . You shouldn't use #include , you should use #include . I strongly urge you to consider using string objects and the #include header, instead of fixed character buffers. I strongly urge you to use fstreams and #include , instead of FILE, fopen, stat, et al. I strongly urge you to use C++ new/delete instead of C malloc/calloc/realloc/free. I'll send you my refactoring of your test_fread.cpp shortly. (Not to the forum.) Sincerely, --Eljay