Original Post
I have a function that takes an array of integers, what I want to know is why you have to define an another array of integers before making the function call. for example :
int Function(int Num[16])
{
}
int main()
{
int arr[]={0,1,0,2,0,3,0,4};
Function(arr);
return 0;
}
why cant I just write,
Function({0,1,0,2,0,3,0,4});
I dont know much about this stuff but when I make the in arr[] array arent I using up extra memory than I would be if I just wrote Function({0,1,0,2,0,3,0,4}). It seems a bit inefficient. I have read something about operator overloading, but Im sketchy on it, so could you overload operators to make it so you can write Function({0,1,0,2,0,3,0,4}) and have it compile, because Ive tried that and it doesnt work.