Number of elements in float array in C -


i have array of float in c. length of array depends of user input. need find out number of elements in array. example:

float a[10] = {3.1314, 1.5131, 9.133,  10.333} 

how can check number of elements? sizeof(a)/sizeof(a[0]) give max number of elements (10 in case).

the number of elements in array of type t[n] n definition. array, of type float[10], has 10 elements, first 4 set values, rest set 0.0f. if want check how many elements have been set, you'll have set rest sentinel value not valid value "set". or can keep track of number of set elements separately.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -