Objective c 嵌套函数被禁用;使用f嵌套函数重新启用

Objective c 嵌套函数被禁用;使用f嵌套函数重新启用,objective-c,nested,Objective C,Nested,我正在学习目标C,我遇到了很大的困难。这是输入的内容,它给了我一个错误。我键入了粗体的文本。有什么问题吗。它在intmain(void) #导入 int main(int argc,const char*argv[]{ NSAutoreleasePool*池=[NSAutoreleasePool alloc]init]; //***包括 内部主(空) 整数金额=1000000; printf(“您帐户中的金额为$%i\n”,金额); 返回0; }** NSLog(@“你好,世界!”); [泳池排

我正在学习目标C,我遇到了很大的困难。这是输入的内容,它给了我一个错误。我键入了粗体的文本。有什么问题吗。它在
intmain(void)

#导入
int main(int argc,const char*argv[]{
NSAutoreleasePool*池=[NSAutoreleasePool alloc]init];
//***包括
内部主(空)
整数金额=1000000;
printf(“您帐户中的金额为$%i\n”,金额);
返回0;
}**
NSLog(@“你好,世界!”);
[泳池排水沟];
返回0;
}

您的问题是C和它的兄弟不喜欢函数中的函数(暂时搁置
gcc
扩展)

您似乎想做的是在
main
中声明一个全新的
main
。这是一个很大的禁忌。我怀疑的是,您已经将整个C程序剪切并粘贴到现有的
main
中间

首先:

#import <Foundation/Foundation.h>
#include <stdio.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [NSAutoreleasePool alloc] init];
    int amount = 1000000;
    printf("The amount in your account is $%i\n", amount);
    NSLog(@"Hello, World!");
    [pool drain];
    return 0;
}
#导入
#包括
int main(int argc,const char*argv[]{
NSAutoreleasePool*池=[NSAutoreleasePool alloc]init];
整数金额=1000000;
printf(“您帐户中的金额为$%i\n”,金额);
NSLog(@“你好,世界!”);
[泳池排水沟];
返回0;
}

你的问题是C和它的兄弟不喜欢函数中的函数(暂且不考虑扩展)

您似乎想做的是在
main
中声明一个全新的
main
。这是一个很大的禁忌。我怀疑的是,您已经将整个C程序剪切并粘贴到现有的
main
中间

首先:

#import <Foundation/Foundation.h>
#include <stdio.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [NSAutoreleasePool alloc] init];
    int amount = 1000000;
    printf("The amount in your account is $%i\n", amount);
    NSLog(@"Hello, World!");
    [pool drain];
    return 0;
}
#导入
#包括
int main(int argc,const char*argv[]{
NSAutoreleasePool*池=[NSAutoreleasePool alloc]init];
整数金额=1000000;
printf(“您帐户中的金额为$%i\n”,金额);
NSLog(@“你好,世界!”);
[泳池排水沟];
返回0;
}
然后从那里一路爬上去