fork(1) download
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main() {
  4. NSAutoreleasePool *pool = [NSAutoreleasePool new];
  5. NSDictionary *inventory = [NSDictionary dictionaryWithObjectsAndKeys:
  6. [NSNumber numberWithInt:13], @"Mercedes-Benz SLK250",
  7. [NSNumber numberWithInt:22], @"Mercedes-Benz E350",
  8. [NSNumber numberWithInt:19], @"BMW M3 Coupe",
  9. [NSNumber numberWithInt:16], @"BMW X6", nil];
  10. NSLog(@"We currently have %ld models available", [inventory count]);
  11. for (id key in inventory) {
  12. NSLog(@"There are %@ %@'s in stock", [inventory objectForKey:key], key);
  13. }
  14. [pool drain];
  15. return 0;
  16. }
Success #stdin #stdout #stderr 0.04s 42848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-05-02 11:51:49.882 prog[17117] We currently have 4 models available
2016-05-02 11:51:49.884 prog[17117] There are 16 BMW X6's in stock
2016-05-02 11:51:49.899 prog[17117] There are 19 BMW M3 Coupe's in stock
2016-05-02 11:51:49.900 prog[17117] There are 13 Mercedes-Benz SLK250's in stock
2016-05-02 11:51:49.900 prog[17117] There are 22 Mercedes-Benz E350's in stock