Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks for ur answer. but i wanted to know whether memory gets allocated during declaration or initialization of a variable?
    – Karthick
    Commented Apr 17, 2015 at 8:02
  • I would like to break declaration and assigned for OP, I tried your code Commented Apr 17, 2015 at 8:03
  • @Karthick in your example int i; the i = 10; is not an initialization but an assignment statetement. At block scope, the i object is allocated when the { where it is declared opens.
    – ouah
    Commented Apr 17, 2015 at 8:35