The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes
Array follows static memory allocation then why it gives garbage value in case of uninitialized array .and it gives zero when the array is partially initialized?
asked in Programming by (105 points) | 72 views

1 Answer

0 votes
yes array follows static memory allocation means the size equal to the size of array is statically allocated in the memory before accessing it. Uninitialized  array gives garbage value at runtime because it follows the local variable concept when we declare array inside the function.when static specifier is used for array or array is declare outside the function  then it will give 0 at run time(partially initialized array).
answered by Active (3.9k points)

Related questions

0 votes
0 answers
asked Nov 20, 2018 in Programming by Na462 Loyal (6.6k points) | 103 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,811 questions
54,527 answers
75,479 users