现在至少帮助我 [英] help me atleast now

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

问题描述

我很抱歉发布了一个不完整的代码。


这里'的完整列表.................

#include< stdio.h>


#include< conio.h>


main()


{


clrscr();


for(; 0;)


printf(Gud Morning);

getch();

返回0;

}

请解释输出............


i在Turbo C ++(3.0)编译器中编译它我确定足够了

它没有被打破.............

解决方案

" muttaa" <关于*********** @ gmail.com>写在

新闻:11 ********************** @ u72g2000cwu.googlegr psps.com:

我很抱歉发布了一个不完整的代码。

这里是完整列表.................

#include< stdio.h>

#include< conio.h>


非标准标题。

main()


int main(无效)

更好。


clrscr();

for(; 0;)

> printf(Gud Morning);
getch();
返回0;
}

请解释输出........ ....


嗯,你没有显示任何输出,是吗?怎么能解释一下

看不到的东西?

i用Turbo C ++编译它(3.0)




我没有那个特定的编译器,所以在摆脱平台

特定的东西后,我得到了这个:


D:\ Home \ asu1\UseNet\clc> cat tc

#include< stdio.h>


int main(void){

for(; 0;) {

/ *请注意以下换行* /

printf(Gud Morning \ n);

}

返回0;

}


D:\Home \ asu1 \ UseNet \ clc> gcc -Wall t.c -o t.exe


D:\Home \ asu1 \ UseNet \ clc> t.exe


D:\Home \ asu1 \UseNet \clc>


上面的程序是否实际输出了一些内容你的系统?


思南

-

A. Sinan Unur< 1u ** @ llenroc.ude.invalid>

(删除.invalid并反转每个组件的电子邮件地址)


muttaa写道:

我是很抱歉发布了一个不完整的代码。

这里是完整列表.................

#include< stdio.h>
#include< conio.h>
main()
{
clrscr();
for(; 0;)
printf (Gud Morning);
getch();
返回0;
}
请解释输出.......... ..

我在Turbo C ++(3.0)编译器中编译它,我确信它没有被打破............ 。




它在Turbo C ++ 1.0编译器上用warnin编译g关于

第13行无法访问的代码,(printf()行),正如你所说,确实执行printf()语句。

执行printf()语句。


奇怪。


muttaa写道:


我很抱歉发布一个不完整的代码。

这里是完整的清单.................
#include< stdio.h> ;
#include< conio.h>

main()
{
clrscr();
for(; 0;)
printf(Gud Morning);
getch();
返回0;
}
请解释输出......... ...

我在Turbo C ++(3.0)编译器中编译它,我确信它没有被打破........... ..




好​​吧,鉴于你没有说出输出是什么,很难解释

它。 :-)


(使用非标准的标题和函数对此事没有帮助。)


假设:


< conio.h>定义下面使用的非标准函数的原型。


clrscr()是清除屏幕的东西。


getch()等待击键。 (可能是因为你在某些环境中运行了

程序,一旦

程序终止,你将失去输出。)


输出是Gud Morning,如你之前的帖子所示。


如果所有这些都是真的,我会说解释是你的编译器

坏了。 for循环中的printf()永远不应该执行。


仅将程序剥离到标准功能:


==== ======


#include< stdio.h>


main()

{

for(; 0;)

printf(" Gud Morning");

getchar();

返回0;

}


==========


此程序应该什么都不显示,等你按Enter键。


-

+ ---------------- --------- + -------------------- + ------------------- ---------- +

| Kenneth J. Brody | www.hvcomputer.com | |

| kenbrody / at\spamcop.net | www.fptech.com | #include< std_disclaimer.h> |

+ ------------------------- + -------------- ------ + ----------------------------- +

不要给我发电子邮件:< mailto:Th ************* @ gmail.com>


i''m sorry for posting an incomplete code.

here''s the full listing.................
#include<stdio.h>

#include<conio.h>

main()

{

clrscr();

for(;0;)

printf("Gud Morning");
getch();
return 0;
}
please explain the output............

i compiled it in Turbo C++ (3.0) compiler which i''m sure enough that
it''s not broken.............

解决方案

"muttaa" <as***********@gmail.com> wrote in
news:11**********************@u72g2000cwu.googlegr oups.com:

i''m sorry for posting an incomplete code.

here''s the full listing.................
#include<stdio.h>

#include<conio.h>
Nonstandard header.
main()
int main(void)

is better.

{

clrscr();

for(;0;)

printf("Gud Morning");
getch();
return 0;
}
please explain the output............
Well, you don''t show any output, do you? How can one explain what one
does not see?
i compiled it in Turbo C++ (3.0)



I don''t have that specific compiler, so after getting rid of platform
specific stuff, I get this:

D:\Home\asu1\UseNet\clc> cat t.c
#include <stdio.h>

int main(void) {
for ( ; 0 ; ) {
/* Note the newline below */
printf("Gud Morning\n");
}
return 0;
}

D:\Home\asu1\UseNet\clc> gcc -Wall t.c -o t.exe

D:\Home\asu1\UseNet\clc> t.exe

D:\Home\asu1\UseNet\clc>

Does the program above actually output something on your system?

Sinan
--
A. Sinan Unur <1u**@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)


muttaa wrote:

i''m sorry for posting an incomplete code.

here''s the full listing.................

#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
for(;0;)
printf("Gud Morning");
getch();
return 0;
}

please explain the output............

i compiled it in Turbo C++ (3.0) compiler which i''m sure enough that
it''s not broken.............



It compiles here on the Turbo C++ 1.0 compiler with a warning about
unreachable code at line 13, (the printf() line), and as you say, does
execute the printf() statement.

Strange.


muttaa wrote:


i''m sorry for posting an incomplete code.

here''s the full listing.................

#include<stdio.h>
#include<conio.h>

main()
{
clrscr();
for(;0;)
printf("Gud Morning");
getch();
return 0;
}

please explain the output............

i compiled it in Turbo C++ (3.0) compiler which i''m sure enough that
it''s not broken.............



Well, given that you don''t say what the output is, it''s tough to explain
it. :-)

(And the use of non-standard headers and functions won''t help the matter.)

Assumptions:

<conio.h> defines prototypes for the non-standard functions used below.

clrscr() is something which clears the screen.

getch() waits for a keystroke. (Probably because you are running the
program in some environment where you would lose the output once the
program terminates.)

The output is "Gud Morning", as suggested in a previous post of yours.

If all these are true, I would say the explanation is that your compiler
is broken. The printf() within the for-loop should never execute.

Strip the program down to standard features only:

==========

#include <stdio.h>

main()
{
for(;0;)
printf("Gud Morning");
getchar();
return 0;
}

==========

This program should display nothing, and wait for you to press Enter.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don''t e-mail me at: <mailto:Th*************@gmail.com>


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

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