Numerical Recipes in C for Macintosh
Peter da Silva
peter at ficc.uu.net
Thu Sep 8 01:44:20 AEST 1988
In article <3834 at bsu-cs.UUCP>, dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
> Actually, for each book on, about, or in, the C programing language,
> you need a separate Macintosh version, or at least an appendix. The
> reason is that on the Macintosh there is no provision for supplying
> argc and argv to a program.
Well since there is stdio emulation (according to recent articles):
#ifndef MAC
main(argc, argv)
int argc;
char *argv[];
#else
main()
{
char args[80], *argv[80];
int argc;
printf("Args: ");
gets(args)
argc = 1;
while(*args) {
while(isspace(*args))
args++;
if(*args) {
argv[argc++] = args;
while(*args && !isspace(*args))
args++;
if(*args)
*args++ = 0;
}
}
argv[argc] = 0;
#endif
--
Peter da Silva `-_-' Ferranti International Controls Corporation.
"Have you hugged U your wolf today?" peter at ficc.uu.net
More information about the Comp.lang.c
mailing list