Is it wrong to do this:
I want to send a multi-dim array to a function, but I want to have the function accept an array of any size. The sizes of each dimension are sent as arguments though, so I'm not flying blind.Code:int data; int *dPtr = data; myFunc( dPtr, 20, 30 );
I mean, I know this works, but I just want to know if I would be shot in a commercial environment for doing it?
And if it is evil, how else can I send multi-dim arrays to functions without explicitly specifying their length? Are VLAs the only way?