fork download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3.  
  4.  
  5. @interface TestObj : Object
  6. {
  7. int num;
  8. }
  9. - (int)foo : (int)k;
  10. @end
  11.  
  12. @implementation TestObj
  13.  
  14. - (int)foo: (int)k
  15. {
  16. num =k;
  17. return 2+num;
  18. }
  19.  
  20. int main()
  21. {
  22. id obj = [[TestObj alloc] init];
  23. int y= [obj foo];
  24. printf ("\i \n",y);
  25. return 0;
  26. }
Runtime error #stdin #stdout 0.02s 10584KB
stdin
Standard input is empty
stdout
Standard output is empty