功能问题中的功能 [英] Function within function problem

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

问题描述

实际上我在函数中定义了一个函数.......而compilinl在出现错误时...声明SYNTEX错误



我尝试了什么:



我试图在外面定义函数而不是它创建一个问题因为...我正在使用类对象所需的二进制文件处理....

Actually i am defining a function within function.......and while compilinl an error in coming...DECLARATION SYNTEX ERROR

What I have tried:

I have tried to define the function outside but than it create a problem becouse...i am using binar file handling for which the class objectis necessary....

推荐答案

C ++语言规范不支持定义函数函数定义的主体中,与 Lambda表达式 [ ^ ]允许在该点定义匿名函数体使用它。



虽然对其他函数中的函数调用没有限制,但是你不能创建一个范围本地的命名函数o f现有的函数体,仅在该外部函数中可用。
The C++ language specification does not support defining a function inside the body of a function definition, with the exception of Lambda Expressions[^] which allow an anonymous function body to be defined at the point at which is it used.

While there is no restriction on calling functions from within other functions, you cannot create a named function which is local to the scope of an existing function body and only available within that "outer" function.


这篇关于功能问题中的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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