Wednesday, September 9, 2009

How to pass an array in function in c


#include "stdio.h"

#define N 5

void fstore1D(int a[], int a_size);

void fretrieve1D(int a[], int a_size);

void fedit1D(int a[], int a_size);

int main()

{

int a[N];

printf("Input data into the matrix:\n");

fstore1D(a, N);

fretrieve1D(a, N);

fedit1D(a, N);

fretrieve1D(a, N);

return 0;

}

void fstore1D(int a[], int n)

{

int i;

for ( i = 0; i < n; ++i )

No comments:

Post a Comment