what does an array contain when it is declared?
For example, when i declare an int array numbers like:
int[] numbers=new int[5];
now without intializing any values, i tried to print that array.So it showed me that all elements inside that array were 0.
Now if 0 means empty, then if i assign some random values to that arrays, and then i assign
say for eg, number[3]=0.
does this mean that that element is empty or it means that it is simply assigned 0 value.
hszforu -3 Junior Poster in Training
Recommended Answers
Jump to PostUninitialized arrays are bitwise zeroed..The values for a uninitialized int array are zero.
Jump to PostSo should i assign 0 value to the remaining elements when i perform an pop operation.
Unnecessary. The
tos
field is what determines where the top of the stack is, and when you push to a spot that's previously been populated, just overwrite the value.However, if you really …
Jump to Postyes i know tos determines the top of stack and i want an empty integer but i am not able to make that element empty, that's why i assigned 0 values to remaining array. Could you tell me how to make any element empty using nullable type?
I don't think …
All 10 Replies
gerard4143 371 Nearly a Posting Maven
hszforu -3 Junior Poster in Training
Mitja Bonca 557 Nearly a Posting Maven
hszforu -3 Junior Poster in Training
Mitja Bonca 557 Nearly a Posting Maven
hszforu -3 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
hszforu -3 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
hszforu -3 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.