Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!sdcc6!jclark From: jclark@sdcc6.ucsd.edu (John Clark) Newsgroups: comp.sys.atari.st Subject: Re: Sozobon C starter question Message-ID: <18773@sdcc6.ucsd.edu> Date: 28 Apr 91 20:48:40 GMT References: <91107.154833JJL101@psuvm.psu.edu> <1991Apr17.143748.13488@hellgate.utah.edu> Organization: University of California, San Diego Lines: 40 In article <1991Apr17.143748.13488@hellgate.utah.edu> jbleaza%peruvian.utah.edu@cs.utah.edu (Jason Bleazard) writes: + +Sozobon expects this really arcane method of passing parameters. +In the above example, try: + + main(argc, argy) + int argc; + char **argy; Arcane???!!! Try as documented in the K&R white book. The ANSI standard method what is listed below. Some notable and wide spread C compilers, such as Sun OS4.1, still use the 'arcane' method. The ANSI method also allows the 'function prototype' to be used and the syntax is the same for either the prototype or the function definition, where as the K&R method would have been a botch. E.g. in ANSI int funct( int p1, struct str *p2); /* function prototype. */ ... int funct( int p1, struct str *p2) /* function definition. */ { ...... } This concept is a 'logical' extention of the C idea that one can 'add' to the definition of a variable as one proceeds, such as extern int array[]; /* first mention of 'array' and typing it. */ .... int array[100]; /* Further definition. */ This allows the 'include' files to declare 'array' external for all modules using 'array' and also allows array to be defined explicitly as required in the definition module. -- John Clark jclark@ucsd.edu