WHY THERE IS ERROR AT THE "BOLD LINE" THAT IS L-VALUE REQUIRED
/*
Write a program which performs the following tasks:
- initialize an integer array of 10 elements in main( )
- pass the entire array to a function modify( )
- in modify( ) multiply each element of array by 3
- return the control to main( ) and print the new array elements in main( )
*/
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int take[10],i;
int array1[10]={1,2,3,4,5,6,7,8,9,10};
int* modify(int*);
*take=modify(array1);*
for(i=0;i<10;i++)
printf("%d ",take[i]);
getch();
}
int* modify(int* array2)
{
int i;
int array3[10];
for(i=0;i<10;i++)
{
array3[i]=3*array2[i];
// printf(" %d",array3[i]);
}
return array3;
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.