I suppose an ordinary function call,
void Example(int i)
{
i=2;
cout << i;
}
int main()
{
int i=1;
example(i);
cout << i;
}
actually copy the variable and so making another instance inside Example(), using double memory (if I am right).
So, under threaded and heavy load environment, would it imposes big impact on performance? Is it always preferably using pointers, or should pass by reference be better for telling the called function where the memory is?