Re: stream io in c
- From: Ron Ford <ron@xxxxxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 04:24:42 -0600
On Thu, 31 Jul 2008 15:04:37 +0530, santosh posted:
// gcc -o chars mkchars2.c
This command is not a conforming implementation of ISO C. For that you
need:
gcc -ansi -pedantic /* For conformance to C90 */
gcc -std=c99 -pedantic /* For incomplete but good conformance to C99
*/
Also add the -Wall and -W flags for extra diagnostics which are always a
help.
//mkchars.c:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *fp;
char name[]="text62.txt";
int c;
if ((fp = fopen(name, "wb")) == NULL)
{
printf("can't open %s\n", fp);
return EXIT_FAILURE;
}
else
{
for (c = 0; c <= 255; c ++) {
putc(c, fp);
}
fclose(fp);
}
return 0;
}
// gcc -o chars -std=c99 -pedantic mkchars3.c
--
When a new source of taxation is found it never means, in practice, that
the old source is abandoned. It merely means that the politicians have two
ways of milking the taxpayer where they had one before. 8
H. L. Mencken
.
- Follow-Ups:
- Re: stream io in c
- From: Keith Thompson
- Re: stream io in c
- From: santosh
- Re: stream io in c
- References:
- stream io in c
- From: Ron Ford
- Re: stream io in c
- From: Ron Ford
- Re: stream io in c
- From: Keith Thompson
- Re: stream io in c
- From: Ron Ford
- Re: stream io in c
- From: santosh
- stream io in c
- Prev by Date: Re: file deletion in a directory with some conditions .
- Next by Date: Re: stream io in c
- Previous by thread: Re: stream io in c
- Next by thread: Re: stream io in c
- Index(es):
Relevant Pages
|