c++ 函数中嵌套函数_可以在C中嵌套函数吗?

c++ 函数中嵌套函数

No, you can’t.

不,你不能。

We can’t define functions inside other functions in C.

我们无法在C中的其他函数中定义函数。

With languages like JavaScript, Swift or Python it is pretty common to use nested functions.

对于JavaScript,Swift或Python之类的语言,使用嵌套函数非常普遍。

C and C++ do not provide this option.

C和C ++不提供此选项。

Your next best option is to put the functions you need to perform something in a separate file, and only expose the primary function a client program needs to use, so you can “hide” all the things that does not need to be public.

您的下一个最佳选择是将需要执行某些功能的功能放在单独的文件中,并且仅公开客户端程序需要使用的主要功能,因此您可以“隐藏”所有不需要公开的内容。

翻译自: https://flaviocopes.com/c-nesting-functions/

c++ 函数中嵌套函数

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值