这是什么奇怪的函数定义是什么意思? [英] What does this weird function definition mean?

查看:171
本文介绍了这是什么奇怪的函数定义是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

博客文章

main()
{
    int n;
    n = 151;
    f(n);
}

f(x)
int x;
{
    printf("%d.\n", x);
}

该职位没有解释它。任何人能解释一下这个奇怪的函数定义意味着什么?

The post doesn't explain it. Can anybody explain what this weird function definition means?

推荐答案

这是在K和C code中的R风格,它仍然是有效的C语法,但我建议你不要在新写$ c。使用它$ C。

This is the K&R style of C code, it's still valid C syntax, but I suggest you not using it in new-written code.

f(x)
int x;

等同于ANSI C:

is equivalent to ANSI C:

void f(int x)


K&放大器; RC 是在第一版中描述的C语言这本书的 C程序设计语言的由Brian Kernighan和丹尼斯里奇,并两位作者的名字命名。更新为使用ANSI C该书的第二版。


K&R C is the C language described in the first edition of the book C programming language by Brian Kernighan and Dennis Ritchie, and named after the two authors. The second edition of the book updated to use ANSI C.

这篇关于这是什么奇怪的函数定义是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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