When I use this code in the main() function, the size (or length) of the array is calculated correctly:
main()
#include int main(void)