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

1 comment

If array is partially initialized then uninitialised locations will contain 0
3
3

1 Answer

1 vote
1 vote

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