少数错误 [英] sh?tpile of errors

查看:54
本文介绍了少数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人有兴趣快速看一下。编译器

给了我很多错误,我不知道从哪里开始。这是我第一次使用

isalpha。

#include< stdio.h>

#include< stdlib。 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(" name is 3rd arg");

ex;

}

double x,y;

FILE * fp;

x = strtod(argv [1],NULL);

y = strtod(argv [2],NULL);

if(fp = fopen(argv [3] ,a))

== NULL){

puts(fopen error);

ex;

}

fprintf(argv [3],"%。2f",x,y);

if(fclose(fp))

== NULL){

puts(fclose error);

ex;

}

返回0;

}


我不知道感叹..


Bill

Would anyone be interested in giving this a quick look. The compiler
gave me so many errors I don''t know where to start. This is my first use of
isalpha.

#include <stdio.h>
#include <stdlib.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("name is 3rd arg");
ex;
}
double x, y;
FILE *fp;
x = strtod(argv[1], NULL);
y = strtod(argv[2], NULL);
if (fp = fopen(argv[3], "a"))
== NULL) {
puts("fopen error");
ex;
}
fprintf(argv[3], "%.2f", x, y);
if (fclose(fp))
== NULL) {
puts("fclose error");
ex;
}
return 0;
}

I dunno sigh..

Bill

推荐答案

在文章< W21lk.68
In article <W21lk.68


EL2.41@trnddc01>," Bill Cunningham" < no **** @ nspam.comwrote:
EL2.41@trnddc01>, "Bill Cunningham" <no****@nspam.comwrote:

任何人都有兴趣快速看一下。编译器
给了我很多错误,我不知道从哪里开始。这是我第一次使用
isalpha。
Would anyone be interested in giving this a quick look. The compiler
gave me so many errors I don''t know where to start. This is my first use of
isalpha.



也许您应该考虑发布您收到的错误...

Perhaps you should consider posting the errors you received...


" Bill Cunningham"写道:
"Bill Cunningham" wrote:

任何人都有兴趣快速看看。编译器

给了我很多错误,我不知道从哪里开始。这是我第一次使用

的isalpha。
Would anyone be interested in giving this a quick look. The compiler
gave me so many errors I don''t know where to start. This is my first use
of isalpha.



看到大量错误并不罕见。从第一个

错误开始向下工作,这就是编译器遇到它们的方式。

专注,专注,专注!


我已经标记了我在修复通常的互联网修改后找到的第一个。

It is not unusual to see a huge number of errors. Start with the first
error and work downward, that''s the way the compiler encountered them.
Focus, focus, focus!

I have marked the first one I found after fixing the usual internet munging.


>

#include< stdio .h>

#include< stdlib.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])){
>
#include <stdio.h>
#include <stdlib.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])) {



***额外'')''上面

*** extra '')'' above


puts(" name is 3rd arg") ;

ex;

}

double x,y;

FILE * fp;

x = strtod(argv [1],NULL);

y = strtod(argv [2],NULL);

if(fp = fopen(argv [3 ],a))
== NULL){

puts(fopen error);

ex;

}

fprintf(argv [3],"%。2f",x,y);

if(fclose(fp))

== NULL) {

put(fclose error);

ex;

}

返回0;

}


我不知道感叹..


比尔

puts("name is 3rd arg");
ex;
}
double x, y;
FILE *fp;
x = strtod(argv[1], NULL);
y = strtod(argv[2], NULL);
if (fp = fopen(argv[3], "a"))
== NULL) {
puts("fopen error");
ex;
}
fprintf(argv[3], "%.2f", x, y);
if (fclose(fp))
== NULL) {
puts("fclose error");
ex;
}
return 0;
}

I dunno sigh..

Bill



这篇关于少数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆