example:
I want to see if array[5] holds a value or is empty.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Elements in primitive arrays can’t be empty. They’ll always get initialized to something (usually
0forintarrays, but depends on how you declare the array).If you declare the array like so (for example):
then all of the elements will default to
0.An alternative syntax for declaring arrays is
where the initial values for an array (of size seven in this case) are given in the curly braces
{}.