array in function?

example program in array having a function

Page 1 of 1

1 Replies - 583 Views - Last Post: 27 February 2008 - 02:57 AM Rate Topic: -----

#1 jencalma  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 89
  • Joined: 13-July 07

array in function?

Posted 27 February 2008 - 02:49 AM

can you give me an example of a program having a function and an array? tnx... :D
Is This A Good Question/Topic? 0
  • +

Replies To: array in function?

#2 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,559
  • Joined: 25-January 07

Re: array in function?

Posted 27 February 2008 - 02:57 AM

#include <stdio.h>

void func();

void main()
{
   func();
}

void func()
{
   int arr[10],i;
   for(i=0;i<10;i++)
   {
      arr[i]=i;
      printf("%d\n",arr[i]);
   }
}



Is that ok? :blink:

Please explain your problem in a descriptive or understandable manner. what kind of example you want? for what you want it? what you have tried so for in that? then post your problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1