Passing arrays to functions in c examples

Code examples

1
0

passing an array to a function in c

...
int arr[M][N];
...
void randomArrayFill(int arr[M][N]) {
//body
}
0
0

c program to pass entire array into a function

#include <stdio.h>
void display( char c)
{
  printf("%c ", c);
}
int main()
{
printf("Welcome to DataFlair tutorials!\n\n");
int i;
char vowels[] = {'a', 'e', 'i', 'o', 'u'};
for (i=0; i<5; i++)
{
display(vowels[i]);
}
return 0;
}

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................