343 views
0 votes
0 votes
if array declared size is larger than values initialised. Then what value rest memory elements have , 0 or garbage?

1 Answer

1 votes
1 votes

It Depends:

Case 1 : If the array is declared inside a function then it will through unkown garbage value.

Case 2: If its Global or static then it will be ZERO.

Related questions

188
views
1 answers
0 votes
srijankarak_123 asked May 7
188 views
let suppose address of first index of array is n and size of each block of array is u. then the index of second element is a+u.let suppose the array has m elements. ... array of same size, if it's address of second last element is (n - u).
276
views
1 answers
0 votes
Anuranjan asked Mar 17, 2019
276 views
How to improve cache hit rate in case of transfer of element from 2-D array to matrix.? (Consider the column major order in 2D array)
347
views
1 answers
1 votes
DIYA BASU asked Feb 3, 2019
347 views
Main memory=512 words.block size=8 words.cache size =32 wordsThere is an array A[100] and each element is 4 words then what is the hit ratio for the following loop.for(i=0;i<=9;i++){for(j=0;j<=9;j=j+2){A[i][j]=A[i][j]+20;}}
953
views
1 answers
0 votes
Sweta Shaw asked Dec 19, 2018
953 views
Suppose we have an array with base address 2000. Each element of the array occupies 2 bytes. And we want to fetch the first 8 bits of the first ... stored in memory location 2000 to 2001 are stored in binary in the array?400401402403404