用C函数嵌套 [英] Nested function in C

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

问题描述

我们能否具有C语言嵌套函数?什么是使用嵌套函数?如果他们存在C不实施从不同的编译器编译器?

Can we have a nested function in C? What is the use of nested functions? If they exist in C does their implementation differ from compiler to compiler?

嵌套允许任何其他语言的功能呢?如果是,那又是什么意义?

Are nested functions allowed in any other language? If yes, then what is their significance?

推荐答案

您不能在标准C.另一个函数中定义一个函数

You cannot define a function within another function in standard C.

您可以的声明的一个函数内部的功能,但它不是一个嵌套函数。

You can declare a function inside of a function, but it's not a nested function.

GCC有语言扩展,允许嵌套函数的。他们是非标准的,因此完全是编译器相关的。

gcc has a language extension that allows nested functions. They are nonstandard, and as such are entirely compiler-dependent.

这篇关于用C函数嵌套的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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