I have a C-array like this:
double arr[] = {
0.0, 0.1, 0.2, 0.5,
0.1, 0.2, 0.3, 0.4,
0.2, 0.0, 0.1, 0.3
};
Is it safe to get the number of elements like this?
int numElements = sizeof(arr)/sizeof(arr[0]);
Or is there a better way?