Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!matt.ksu.ksu.edu!jerry From: jerry@matt.ksu.ksu.edu (Jerry J. Anderson) Newsgroups: comp.lang.c Subject: Re: More problems with passing functions as arguments. Message-ID: <1991Mar21.114006.2523@maverick.ksu.ksu.edu> Date: 21 Mar 91 11:40:06 GMT Sender: news@maverick.ksu.ksu.edu (The News Guru) Distribution: na Organization: Kansas State University Lines: 35 In article <27546@uflorida.cis.ufl.EDU> pm0@reef.cis.ufl.edu (Patrick Martin) writes: [original code deleted] >This code works fine when compiled with gcc or my compiler at home. >When compiled with some of the older implementations of C it fails. > >Is there a way I can get this to run with some of the older versions >of C? The following compiles under either gcc or cc (non-ANSI). void function(i) int i; { printf("\nThe Number Is: %d\n\n",i); } pass_me_a_function(f) void (*f)(); { f(1); } main() { pass_me_a_function(function); } -- "The size of an array is the size of an Jerry J. Anderson array; the size of a pointer is the size Computing Activities of a pointer." - Tim Ramsey, under the Kansas State University influence of little blue pills. Manhattan KS 66506