sizeof(an_array) only returns the number of bytes in the array for static arrays. if you try this with a dynamically allocated array, you will return sizeof(pointer)
if you were to use memset, you would need to:
if you wanted to initialize the memory all at once, you would have to do the indexing yourself.
you lose the  notation this way, so you'd do better to use a wrapper class e.g:
int* 2darray = new int[height*width];
2darray(unsigned int _width,unsigned int _height):
const unsigned int height;
const unsigned int width;
int* operator(unsigned int y)
//uncompiled, untested - simply for demonstration purposes.
using the STL is probably the better choice, however.