后函数名称声明函数参数 [英] Declaring function parameters after function name

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

问题描述

int func(x)
int x;
{
    .............

这是什么种类的声明叫什么名字?

What is this kind of declaration called?

当它是有效/无效,包括C或C ++,一定标准的修订和编译器?

When is it valid/invalid including C or C++, certain standard revisions and compilers?

推荐答案

它仍然有效,但它是pre-ANSI。这实际上是那里的K&放大器; R缩进风格而得名。开幕式支架功能块之后的行,因为这看起来奇怪:

It's still valid, but it's pre-ANSI. That's actually where the K&R indent style got its name. The opening bracket is on the line after the function block because this looks weird:

int func(x)
int x; {
...
}

总之,不推荐使用这种风格,因为与函数原型的一个问题。

这篇关于后函数名称声明函数参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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