From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 16:36:21 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3030B16A41C for ; Wed, 6 Jul 2005 16:36:20 +0000 (GMT) (envelope-from reidrac@usebox.net) Received: from blackshell.usebox.net (84-120-176-87.onocable.ono.com [84.120.176.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5780543D45 for ; Wed, 6 Jul 2005 16:36:19 +0000 (GMT) (envelope-from reidrac@usebox.net) Received: from [192.168.0.1] (fixed-1-lan.blackshell.usebox.net [192.168.0.1]) by blackshell.usebox.net (8.13.0/8.13.0) with ESMTP id j66GaAxX018950; Wed, 6 Jul 2005 18:36:10 +0200 (CEST) From: "Juan J." =?ISO-8859-1?Q?Mart=EDnez?= To: Matt In-Reply-To: <42518AC9.5070208@comcast.net> References: <42518AC9.5070208@comcast.net> Content-Type: text/plain; charset=ISO-8859-1 Date: Wed, 06 Jul 2005 18:36:09 +0200 Message-Id: <1120667769.8695.10.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 07 Jul 2005 12:11:06 +0000 Cc: freebsd-hackers@FreeBSD.ORG, misc@openbsd.org Subject: Re: C programming question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2005 16:36:21 -0000 El lun, 04-04-2005 a las 11:43 -0700, Matt escribió: > [...] > Can someone break down these declarations (if that's what they are)? Is > this a form of typecasting? Thanks for your help. Those are declarations of pointers to functions. /* real function */ void dumb(int a) { return a; } ... /* here follows a declaration of func pointer */ int (*func_ptr)(int); int a; /* assign it */ func_ptr=dumb; /* use it */ a=func_ptr(123); Any good book about C should cover this. Look for OOP in C also, it's frequent use pointers to functions + structs to add classes to C. regards, Juanjo -- Desarrollo y sistemas: http://www.usebox.net/ Página Personal: http://www.usebox.net/jjm/