Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Array Problems Message-ID: <5981@goanna.cs.rmit.oz.au> Date: 27 May 91 09:04:56 GMT Article-I.D.: goanna.5981 References: <14724@ucrmath.ucr.edu> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 40 This is not the real problem, but in article <14724@ucrmath.ucr.edu>, duchow@watnxt3.ucr.edu (John Duchowski) writes: > input(argc, argv, x, y, header) > int *argc; <------ > char *argv[]; ... > output(argc, argv, x, y, n, header) > int *argc; <------ > char *argv[]; ... > main(argc, argv) > int argc; > char *argv[]; > { ... > n = input(argc, argv, x, y, &header); <------ ... ^^^^ > output(argc, argv, x, y, n, &header); <------ ^^^^ That suggests that the functions should have been declared void input(argc, argv, x, y, header) int argc; char *argv[]; ... void output(argc, argv, x, y, n, header) int argc; char *argv[]; ... and that there may be other problems lurking around that 'lint' (surely the NeXt has 'lint'?) would catch. Myself, I always write "char **argv;"; C doesn't really understand arrays as parameters, and using a notation that suggests that it does will only get you in trouble. -- I rejoiced that at least So-and-So could spell "hierarchical", but the _real_ explanation was that he couldn't spell "heir". -me