0
How to find array length in C Programming Language?
I was able to get length of array in C. But it is only giving me initial length of array not updated i.e., after adding new value in array. Here is mine program:: https://code.sololearn.com/cb1dF7V2ZVx9/?ref=app PLEASE HELP!
7 Antworten
+ 4
Yes, arrays are of fixed length. You might need to use dynimic arrays or another dynamic length data structure.
a [3] = 55 is not adding a new element to the array. In order to understand it you should learn more about pointers and memory.
Arrays are a continuous block of memory.
https://www.sololearn.com/learn/C/2933/
Keep in mind that a[k] is the same as *(a + k).
+ 4
Yes it's possible and you did it well.
What you need to understand is that you can't change the length of the array. It will remain the same.
a [ 3 ] = 55 won't change the array. See my previous answer.
+ 2
Array is fixed length. Though C let you do so, but such thing could lead problems in the computer.
+ 2
Ok Thanks!
0
Kevin ★
CarrieForle
So, this is not possible to get array lenght
0
Ok