Please clear it off (global n local)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sivasujithsp
    New Member
    • Jun 2007
    • 4

    Please clear it off (global n local)

    Hi everyone...

    Am new to the forum and i need all ur support and interaction.

    On declaration a local variable contains garbage value whereas a global variable is automatically initialized with 0.

    can you please tell me why this happens........ .. if this is already posted plz get me the link....


    thnx in advance....

    Sujith
  • OuaisBla
    New Member
    • Jun 2007
    • 18

    #2
    This is related to your C++ compiler behaviour. But normally, in C++ both should be uninitialized, specially in release build.

    Also, I think you are referering to builtin types right? Those doesn't have default contructors. This is inherited from C long ago.

    Comment

    Working...