// 函数嵌套:函数作用域中定义了另外一个函数,内层函数的作用域中可以使用外层函数的参数
func helloLanou(var num: Int){
num++
func hello23(){
num++
}
hello23()
num
}
helloLanou(10)
func hellolanou2() -> ((Int) -> String) {
func hanshu (i:Int) -> String
{
return "\(i)"
}
return hanshu
}
hellolanou2()
let hanshu = hellolanou2()
let i = hanshu(
Swift高级开发语言--函数嵌套
最新推荐文章于 2016-07-26 11:53:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)