fork download
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main() {
  4. NSAutoreleasePool *pool = [NSAutoreleasePool new];
  5. int n[ ] = { 11, 22, 33, 44 }; /* n is an array of 4 integers with the values especified */
  6.  
  7. /* initialize elements of array n to 0 */
  8. int i;
  9. for(i = 0; i < 4; i++ ) {
  10. n[ i ] = n[ i ]+100; /* set element at location i to n[ i ] + 100 */
  11. }
  12.  
  13. /* output each array element's value */
  14. int j;
  15. for(j = 0; j < 4; j++ ) {
  16. NSLog(@"Element[%d] = %d\n", j, n[j] );
  17. }
  18. [pool drain];
  19. return 0;
  20. }
  21.  
Success #stdin #stdout #stderr 0.03s 42848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-05-02 11:13:55.971 prog[952] Element[0] = 111
2016-05-02 11:13:55.972 prog[952] Element[1] = 122
2016-05-02 11:13:55.972 prog[952] Element[2] = 133
2016-05-02 11:13:55.972 prog[952] Element[3] = 144