Q:

Number of elements in a static array

How to get an output that tells me that I have 56 elements in this array.
static uint16_t test[200] = 
{
    50, 32, 1, 5, 23, 5, 7, 56, 754, 6, 
    243, 23, 5, 5, 6, 35, 35, 67, 3, 5324, 
    51, 24, 23, 4, 2346, 54, 45, 345, 32, 4, 
    234, 12, 5, 43, 656, 37, 563, 6, 542, 543, 
    52, 35, 342, 673, 3, 6, 54, 624, 3, 545, 
    2, 345, 2435, 24, 6, 54
};

I have tried different things that work if it is not static and the number of max elements is not set. Like
int count = 0;
uint16_t *p;

for(p = test; p < &test + 1; p++)
    count++;

Or,
sizeof(test) / sizeof(uint16_t);

But as soon as it sets the maximum of elements to 200 then it always returns 200.

A:

How to get an output that tells me that I have 56 elements in this array.
static uint16_t test[200] = 50,32,1,5,23,5,7,56,754,6,243,23,5,5,6,35,35,67,3,5324,51,24,23,4,2346,54,45,345,32,4,234,12,5,43,656,37,563,6,542,543,52,35,342,673,3,6,54,624,3,545,2,345,2435,24,6,54};

You won't, because your assumption is wrong. This array has 200 elements, no matter what. If you only initialize the first 56 of it, the others are default-initialized to 0 -- they are still there.
That said, if 0 isn't considered a "valid" value, you could simply count the "valid" ones like e.g.
size_t count;
for (count = 0; test[count]; ++count);

Otherwise, just hold the actual count of used places in a variable.

Side note, your calculation of the array size
sizeof(test)/sizeof(int)

is wrong, because the type doesn't match. To avoid errors like this, don't use type names with sizeof but always expressions:
sizeof test / sizeof *test

*test here evaluates to the first element, which has type uint16_t, and that's the type used by sizeof. Also note parantheses aren't needed when you use sizeof with an expression.

