From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 22:37:13 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9814E16A417 for ; Tue, 23 Oct 2007 22:37:13 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.bluestop.org (muon.bluestop.org [IPv6:2001:41c8:1:548a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6CAEE13C491 for ; Tue, 23 Oct 2007 22:37:13 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.draftnet (unknown [IPv6:2a01:348:10f:1::5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTP id 8899130181; Tue, 23 Oct 2007 23:37:12 +0100 (BST) Message-ID: <471E7778.4060909@cran.org.uk> Date: Tue, 23 Oct 2007 23:36:40 +0100 From: Bruce Cran User-Agent: Thunderbird 2.0.0.6 (X11/20070809) MIME-Version: 1.0 To: cpghost References: <200710232044.53240.h.schmalzbauer@omnisec.de> <20071023220134.3abd635e@epia-2.farid-hajji.net> <20071023162454.93851854.wmoran@potentialtech.com> <200710232324.09851.h.schmalzbauer@omnisec.de> <20071024002649.6cc41512@epia-2.farid-hajji.net> In-Reply-To: <20071024002649.6cc41512@epia-2.farid-hajji.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org, Harald Schmalzbauer Subject: Re: Mentor for C self study wanted X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2007 22:37:13 -0000 cpghost wrote: > There's a mismatch here: scanf("%d", ...) expects a pointer to int, > while &nnote is a pointer to a short. Normally, an int occupies more > bytes in memory than a short (typically sizeof(int) == 4 on 32bit > platforms, and sizeof(int) == 8 on 64bit platforms; while typically > sizeof(short) == 2). I think short and int stay the same on both 32 and 64 bit platforms, while it's only long that gets bumped to 8 bytes. At least that seems to be what happens on FreeBSD amd64. -- Bruce