nested-func-1.m

来自「用于进行gcc测试」· M 代码 · 共 37 行

M
37
字号
/* Test basic nested C function functionality within ObjC   methods.  *//* Contributed by Ziemowit Laski <zlaski@apple.com>.  */#include <stdio.h>#include <stdlib.h>#include <objc/objc.h>#include <objc/Object.h>int bappy (int (*blargh) (int a, int b, int c)){  return blargh (4, 7, 2) + 3;}@interface Foo: Object+ (int)foo;@end@implementation Foo+ (int)foo{  int blargh (int a, int b, int c)  {    return a * b + c;  }  return bappy (blargh);}@endint main () {  int f = [Foo foo];  if (f != 33)    abort ();  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?