# Array to Functions

This article shows that, functions can be used to modify the elements of the array. Arrays are passed by value to the function. This is possible because the value of the array variable is the address of the variable.

This example shows two function add and display. add function inserts the elements in the array and display function shows the elements of the array.

#include<iostream>
using namespace std;
{
for(int i=0;i<size;i++){
cout<<"a["<<i<<"] : ";
cin>>a[i];
}
}
void display(int a[],int size){
cout<<"The elements are ";
for(int i=0;i<size;i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
int main(){
int size;
cout<<"Enter size of array : ";
cin>>size;
int a[size];
}