K
Keith Thompson
Bill Cunningham said:Assuming gcc & bash, try:
$ gcc foo.c 2>&1 | less
Bill, if you can't get OE Quotefix to work for you, then please pay
attention when you post a followup. If the article to which you're
replying was posted through Google Groups, please do *something* to
indicate the division between the quoted material and your new text.
Here's a reposting of the source.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define ex exit(EXIT_FAILURE)
int main (int argc, char *argv[]) {
if (argc!=4) {
puts("print usage error");
ex;
}
if (isalpha(argv[1]) || isalpha(argv[2]) {
puts("print non alpha allowed");
ex;
}
FILE *fp;
double x,y;
x=strtod(argv[1],NULL);
y=strtod(argv[2],NULL);
if (fp=fopen(argv[3],"a"))==EOF) {
puts("fopen error");
}
fprintf(fp,"%.2f",x,y);
if (fclose(fp))==EOF) {
puts("fclose error");
}
return 0;
}
This still has syntax errors. Look at the line with the isalpha
calls. Count the parentheses.
Here's your next assignment. Do not post code that produces an error
message containing the phrase "syntax error" or "parse error". In
most cases, that will be the very first error reported by the
compiler. Fix that error and recompile. Repeat until you have no
syntax errors. *Then* you can post your code and ask for further
help.