忽略在C文件中的文件stdio.h中 [英] Ignoring the stdio.h file in a c file

查看:109
本文介绍了忽略在C文件中的文件stdio.h中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/336814/why-include-stdio-h-is-not-required-to-use-printf\">Why #包括LT&;&stdio.h中GT;是*不*需要用printf()?

我面临的一个问题在下面给出code。

I am facing a problem in the below given code.

int main()
{
printf("\nHello Stack Overflow\n\n") ;
return 0 ;
}

在上面提到的code我离开其中的#include。
如果我编译和执行这一块code,正如预期的输出打印。但的#include是在C程序中最重要的事情,我都忽视了它,还是在编译没有任何错误,但有警告完成。

In the above mentioned code i left including "#include ". And if i compile and execute this piece of code, the output is printed as expected. But "#include " being the most important thing in a C program, i have ignored it and still the compilation is done without any errors but with warning.

为什么会出现这种情况?

Why is this happening?

推荐答案

在C,未声明的隐含考虑到返回 INT ,并采取<$函数C $ C> INT 参数。

In C, functions that are not declared are implicitly considered to return an int and to take int arguments.

这是坏习惯的,并会咬你。例如,如果你要打印的数据不是int的大小相同,如双击浮动

This is bad practice and will bite you. For example if you want to print data not the same size of an int, like double or float.

这篇关于忽略在C文件中的文件stdio.h中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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