I am currently trying to get the length of a dynamically generated array. It is an array of structs:
typedef struct _my_data_ { unsigned int id; double
You're trying to use a pretty well known trick to find the number of elements in an array. Unfortunately arr in your example is not an array, it's a pointer. So what you're getting in your sizeof division is:
arr
sizeof
sizeof(pointer) / sizeof(structure)
Which is probably always going to be 0.