Lesson 11 of 23
ArraysArrays
9 min 25 XP
Array ஒரே type-ன் பல மதிப்புகளை அடுத்தடுத்த memory இடங்களில் சேமிக்கும். Index 0-லிருந்து தொடங்கும். C, array எல்லையைச் சோதிக்காது; a[10] என்ற 5 அளவு array-ல் எழுதினால் memory பாழாகும், கவனம்!
An array stores values of one type in consecutive memory. Indexes start at 0. C does not check bounds: writing a[10] in a 5-element array corrupts memory, so be careful!
Example: edit me and press Run
Press Run to see the result here.Example: edit me and press Run
Press Run to see the result here.sizeof(arr) / sizeof(arr[0]) array-ன் உறுப்புகளின் எண்ணிக்கையைத் தரும் (array அதே function-ல் உருவாக்கப்பட்டிருந்தால் மட்டும்).
sizeof(arr) / sizeof(arr[0]) gives the number of elements, but only in the function where the array was declared.