I just come across the following problem:
void func( int (&arr)[3] ){...}
int main( int argc, char* argv[] )
{
int* a = new int[3];
a[0]=0, a[1]=1, a[2]=2;
f(a);// how to convert a int* to int(&)[3]?
delete[] a;
return 0;
}
My point is how could I convert the pointer "a" to the required int array?