How garbage values are assigned to variables in c

Does it mean C first allocates memory to variable ‘a’ and then what ever there is at that memory location becomes value of ‘a’?

Exactly!

Basically, C doesn’t do anything you don’t tell it to. That’s both its strength and its weakness.

Leave a Comment