If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

And from now, something is happening that I cannot understand:
20. func({0,0},0,0) for Outputing "10"
Why so? If func has itselfs local variables, including a[2]={0,0}.
I was expecting this:
20. func({0,0},0,0) for Outputing "00"

If you want to pass an array to a function by value, you can wrap it in a struct and pass the struct or use std::array (std::tr1::array in older compilers). std::vector can also be a good alternative.

actually, they are exactly the same; function parameters of array type ( with or without bounds ) always decay to a pointer type when the function type is formed. So, the types T*,T[],T[N] are different but the types void(*)(T*),void(*)(T[]),void(*)(T[N]) are indeed exactly the same.