title: functions calling from main method objective c
body: <p>Here I need to write a function which is called from main method with integer array as a parameter please give me example.</p>
  
  <p>In below example parameter are int type.</p>
  
  <p><strong>Note</strong> : please tell this is correct way to do this or not...</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  void displayit (int);
  
  int main (int argc, const char * argv[])
  {
      @autoreleasepool {
          int i;
  
          for (i=0; i&lt;5; i++)
          {
                  displayit( i );
          }
  
     }
     return 0;
  }
  
  void displayit (int i)
  {
          int y = 0;
  
          y += i;
  
          NSLog (@"y + i = %i", y);
  }
  </code></pre>
  
  <p>Thanks in advance....</p>