It's said that when we pass an array to a function then only copy of that array is passed to the function. If we modify the array inside that function then original array would also be affected. So will case 1 take equal memory or it would consume significantly higher memory when compared to case 2 ?
//Case 1:-
int sum(vector<int> v)
{
...
}
//Case 2:-
int sum(vector<int> &v)
{
...
}