1 Can a function in C return an array Can a function return
1. Can a function in C++ return an array? Can a function return a vector?
Solution
1-C++ doesn’t have ability to return an array passed directly as function argument rather than you can return a pointer to that particular array which you want to define
int *functionname(int a[])
{ // declare function that returning pointer to array
return a;
}
2-Create a vector your std::vector and design a large array and place it inside vector in a fuction
now if you want to return it back at the point where the function is called you can do in the following way
std::vector<int> fununction(){
return v;
}
int main(){
std::vector<int> a = fuctionn();
return 0;
}
