Date: Tue, 23 Oct 2007 23:36:40 +0100 From: Bruce Cran <bruce@cran.org.uk> To: cpghost <cpghost@cordula.ws> Cc: freebsd-questions@freebsd.org, Harald Schmalzbauer <h.schmalzbauer@omnisec.de> Subject: Re: Mentor for C self study wanted Message-ID: <471E7778.4060909@cran.org.uk> In-Reply-To: <20071024002649.6cc41512@epia-2.farid-hajji.net> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?471E7778.4060909>