Agree with Mark and Paul. You will have to pass the size of the array along with the array function argument itself.
As a side note, when declaring static constant arrays, I tend to group the definition and another "size" value together. For example, say if I have your float array defined as a static constant global (e.g., scoped to a local .cpp file), then I would define a corresponding "size" value as follows:
static const float VERTS[] = {
-1.0, 1.0, 1.0,
1.0, 1.0, 1.0,
1.0,-1.0, 1.0,
1.0,-1.0, 1.0,
-1.0, 1.0,-1.0,
1.0, 1.0,-1.0,
1.0,-1.0,-1.0,
-1.0,-1.0,-1.0
};
static const unsigned int VERTS_SIZE = sizeof(VERTS) / sizeof(VERTS[0]);
This will allow me to easily iterate over the contents of the vertices without having determine the size every time.
for (unsigned int i = 0; i < VERTS_SIZE; i++)
float fValue = VERTS[i];