Or we could use something no one will complain on --> vector arrays!
I will complain.
To pass a 2d array as a double pointer, you have to build a pointer array:
Code:
int ar[4][4];
int *arps[4] = { &ar[0][0], &ar[1][0], &ar[2][0], &ar[3][0] };
func(arps, 4, 4);
Better would be to pass a single pointer.
Code:
void func(int *ar2d, int rows, int cols);
int ar[4][4];
func(&ar[0][0], 4, 4);
But anyway, when dealing with multi-dimensional arrays, nothing beats Boost.MultiArray.
http://www.boost.org/
laserlight, that's interesting. The 1997 draft doesn't mention rvalue arrays in that paragraph. So it definitely is something added afterwards, which means someone either was pedantic without thinking, or discovered a way to get an rvalue array.
Let's see. The real distinction between lvalues and rvalues is that an lvalue's address can be taken. That's actually true for array variables, even though some compilers do the wrong thing there.
You get rvalues by conversion from lvalues as per 4.1, but that excludes arrays. You can get rvalues by creating temporaries, but there's no way to create a temporary array: initializer lists aren't arrays, and a function can't return an array. Hmm ... you can't cast to an array. In particular, note that any cast that is not to a reference performs lvalue-to-rvalue or array-to-pointer conversion on its argument before casting, so you can't have a cast from an array either, unless it's a cast to "reference to array", which might be possible with reinterpret_cast, but results in an lvalue.
So I think the rvalue array is a phantom, and the wording change a result of unthinking pedantery. Pedantism. Whatever.