这有什么不对?我做了一个基本的C程序。请帮助我 [英] What is wrong here ? I have done a basic C program .please help me

查看:71
本文介绍了这有什么不对?我做了一个基本的C程序。请帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include< stdio.h>

void main()

{

printf(hello);

}

这个程序由我做错了...............怎么办??????



我尝试了什么:



此代码由我试用.....我已经尝试了上面的上述代码

解决方案

没有。

该代码编译并运行正常:它产生一个输出 - 单词你好 - 并退出。当然,根据我的内部编译器,它应该和在线C编译器 [ ^ ]同意我的意见。



如果那就是你想要的它要做,然后它做得很好。

如果它不是你想要它做的,你将不得不更加努力地思考你想要执行的任务和代码那个!



是什么让你认为这是错的?


很可能,你没有时间看到显示的消息因为程序一完成任务就会退出。

也许你可以试试

  int  main(){
printf( hello);
system( pause);
}



这将允许您实际看到生成的结果。



希望这会有所帮助。


#include<stdio.h>
void main()
{
printf("hello");
}
this program done by me whats wrong in...............how to do ??????

What I have tried:

this code is tried by me.....i have tried the above codw as above

解决方案

Nothing.
That code compiles and runs fine: it produces an output - the word "hello" - and exits. Certainly according to my "internal" compiler it should, and an Online C Compiler[^] agrees with me.

If that is what you wanted it to do, then it does it very well.
If it isn't what you wanted it to do, you are going to have to think harder about the task you are trying to perform and code for that!

What makes you think it is wrong?


Most probably, you do not have time to see the message displayed since the program exits as soon as it has done its task.
Maybe you could try

int main() {
   printf("hello");
   system("pause");
}


which would allow you to actually see produced result.

Hope this helps.


这篇关于这有什么不对?我做了一个基本的C程序。请帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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