This question shows research effort; it is useful and clear
0
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
我刚刚遇到以下问题:
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;
}