thank you both but I have like 5 or 6 arrays in my program and I have wrote the whole program with arrays. if I wanna change them to vectors then I'll have to develop the program from the beginning. I've got a question here. if I use vector in my function then I should return vector<int>. and I have to assign it to an array later, when the function is called. can I do such a thing?
somewhat like:
for(int i=0 ; i<myvector.size() ; i++)
s1[i]=myvector[i];
and there is another point. by passing the array to the function(as shown below) I meant it to be changed (it is not important that array s be changed or not. coz it's not directly used in the program)
Code:
int s[1000];
int* function(int a,int c, int b,int*s)
{
.
s[i]=p;
.
return s;
}
for(int y=0 ; y<b+1; y++)
s1[y]=*(function(4,n,b,s)+y);