An array of data and the size of the array of data are almost always passed together. If they are passed together so frequently, they should really be wrapped so they can't *not* go together.
At the simplest:
struct ByteBuffer
{
size_t bytes;
Byte *data;
};
But really, arrays of byte data is used frequently enough that it should have a nice class with plenty of helper functions, proper constructors/destructors move-semantics and all that.
Write one, use an existing one, or take mine:
ByteBuffer class (header)
ByteBuffer class (source) (just replace the logging and asserts, and it'll compile fine with no dependencies)