//I am doing this with the pointer as:
#include
#include
int *fun1(int ar[])
{
return ar;
}
int main()
{
int n,i,arr[10],*d;
printf("Enter the element of array:");
scanf("%d",&n);
for(i=0;i
{
scanf("%d",&arr[i]);
}
printf("Array you get from the function is:");
d=fun1(arr);
for(i=0;i
{
printf("%d\t",*(d+i));
}
return 0;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
BUT Only with Array i am not doing same operation please give me solution.
#include
#include
int * fun1(int ar[])
{
return ar;
}
int main()
{
int n,i,arr[10],d[10];
printf("Enter the element of array:");
scanf("%d",&n);
for(i=0;i
{
scanf("%d",&arr[i]);
}
printf("Array you get from the function is:");
d=fun1(arr);
for(i=0;i
{
printf("%d\t",(d+i));
}
return 0;
}
Replies
Know the answer? Post it — somebody with the same question will find it here.