From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 22:52:26 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 244FE16A417 for ; Tue, 23 Oct 2007 22:52:26 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id C2ED713C48E for ; Tue, 23 Oct 2007 22:52:25 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from epia-2.farid-hajji.net (epia-2 [192.168.254.11]) by fw.farid-hajji.net (Postfix) with ESMTP id 27468E0496; Wed, 24 Oct 2007 00:52:10 +0200 (CEST) Date: Wed, 24 Oct 2007 00:52:08 +0200 From: cpghost To: Bruce Cran Message-ID: <20071024005208.0a8048e4@epia-2.farid-hajji.net> In-Reply-To: <471E7778.4060909@cran.org.uk> 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> <471E7778.4060909@cran.org.uk> Organization: Cordula's Web X-Mailer: Claws Mail 3.0.1 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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:52:26 -0000 On Tue, 23 Oct 2007 23:36:40 +0100 Bruce Cran wrote: > 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. Hmmm... yep, you're right, I'm wrong! I've switched compilers too often recently. Yes, on gcc sizeof(int) == 4 on both 32bit and 64bit. Thanks for pointing this out: I stay corrected. ;) -- Cordula's Web. http://www.cordula.ws/