Article View: comp.std.c
Article #4015Re: EXIT_FAILURE problem
From: Jeremy Fitzhardinge
Date: Mon, 18 Sep 1995 11:13
Date: Mon, 18 Sep 1995 11:13
24 lines
1120 bytes
1120 bytes
In <DEvBA5.HEF@thomsoft.com> kst@thomsoft.com (Keith Thompson) writes:
>In <jeremy.810996048@suede.sw.oz.au> jeremy@sw.oz.au (Jeremy Fitzhardinge) writes:
>> This is getting pretty silly. Why have the standard define something
>> completely undefined?
>
>The system() function is defined in the standard (7.10.4.5), and it
>(very nearly) can't be used portably.
But at least you can write code which will compile using it, since has a defined
type. Besides, who'd use it in real code?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char buf[15]; /* all commands are short */
printf("enter a command:");
gets(buf);
system(buf);
exit(0);
}
J
Technical Details
Message-ID:
<jeremy.811422821@suede.sw.oz.au>Path:
arc1-ca.pugleaf.net!swallow.sw.oz.au!jeremyReferences:
<42nsuq$bon@elf.bsdi.com> <1995Sep11.221423.6651@forte.com> <jeremy.810996048@suede.sw.oz.au> <DEvBA5.HEF@thomsoft.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!swallow.sw.oz.au!jeremy From: jeremy@sw.oz.au (Jeremy Fitzhardinge) Newsgroups: comp.std.c Subject: Re: EXIT_FAILURE problem Date: 18 Sep 95 11:13:41 GMT Organization: Softway Pty Limited Message-ID: <jeremy.811422821@suede.sw.oz.au> References: <42nsuq$bon@elf.bsdi.com> <1995Sep11.221423.6651@forte.com> <jeremy.810996048@suede.sw.oz.au> <DEvBA5.HEF@thomsoft.com> NNTP-Posting-Host: suede.sw.oz.au