I want to pass array to function in C/C++ without declaring and assigning it previously. As in C# we can:
fun(new int[] {1, 1}); //this is a function call for void fun(int[]) type function
I am not very sure about the correctness of the above code. But I had done something like this in C#.
How can we pass array to function using dynamic declaration (on the spot declaration)??
I'd tried it using following way. But no luck
fun(int {1,1});
fun(int[] {1,1});
fun((int[]) {1,1});
can't we do so..??