From owner-freebsd-hackers Fri Jun 14 15:36:24 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84]) by hub.freebsd.org (Postfix) with ESMTP id 2267037B407 for ; Fri, 14 Jun 2002 15:36:19 -0700 (PDT) Received: from fwd06.sul.t-online.de by mailout09.sul.t-online.com with smtp id 17Izg1-0005Ju-00; Sat, 15 Jun 2002 00:36:17 +0200 Received: from pc5.abc (520067998749-0001@[217.233.84.225]) by fmrl06.sul.t-online.com with esmtp id 17Izft-1E4luKC; Sat, 15 Jun 2002 00:36:09 +0200 Received: (from nicolas@localhost) by pc5.abc (8.11.6/8.11.6) id g5EMa8b16643 for hackers@FreeBSD.ORG; Sat, 15 Jun 2002 00:36:08 +0200 (CEST) (envelope-from list@rachinsky.de) Date: Sat, 15 Jun 2002 00:36:08 +0200 From: Nicolas Rachinsky To: hackers@FreeBSD.ORG Subject: Re: sorting in C Message-ID: <20020614223608.GA16612@pc5.abc> Mail-Followup-To: hackers@FreeBSD.ORG References: <20020614124530.GA16778@lnuxlab.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Powered-by: FreeBSD X-Homepage: http://www.rachinsky.de X-PGP-Keyid: C11ABC0E X-PGP-Fingerprint: 19DB 8392 8FE0 814A 7362 EEBD A53B 526A C11A BC0E X-PGP-Key: http://www.rachinsky.de/nicolas/nicolas_rachinsky.asc X-Sender: 520067998749-0001@t-dialin.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Dan Arlow [2002-06-14 14:40 -0400]: > dumb question: extra "&" in the previous post? > > why do both this > > qsort(&array, NUM_INTS, sizeof(*array), > > (int (*)(const void *, const void *)) comp); > and this > qsort(array, NUM_INTS, sizeof(*array), > (int (*)(const void *, const void *)) comp); > > work properly? I tried both and both compile/run/sort fine. > > (the difference afaik is that the first passes an *int[] aka int** and the > second passes an int[] aka int*) No, see http://www.eskimo.com/~scs/C-faq/q6.12.html Nicolas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message