Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Variable values before initialisaton
@ 2006-11-23 17:12 Rob Quill
  2006-11-23 17:27 ` Vladimir Prus
  0 siblings, 1 reply; 10+ messages in thread
From: Rob Quill @ 2006-11-23 17:12 UTC (permalink / raw)
  To: gdb

Hi,

Sorry to ask to many questions in one day. but I was wondering fi
anyone could explain why a variable can have a value before it has
been declared.

In my code I have:

int i = 0;
int j = 2;
int k = 3;

and if I print the value of k any time before it has been set to 3, it
get it being equal to a very large number, rather than it not being in
the current scope. Is this a debugging thing, or something to do with
the way the code is compiled, or something else?

Thanks,

Rob


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-11-28 19:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-23 17:12 Variable values before initialisaton Rob Quill
2006-11-23 17:27 ` Vladimir Prus
     [not found]   ` <baf6008d0611230932o355f2ba6h9f6b0e778c82bce@mail.gmail.com>
2006-11-23 17:32     ` Rob Quill
2006-11-23 19:55       ` Daniel Jacobowitz
2006-11-23 19:58         ` Rob Quill
2006-11-24  6:53         ` Vladimir Prus
2006-11-24 15:15           ` Daniel Jacobowitz
2006-11-27 20:09             ` Jim Blandy
2006-11-28 11:21               ` Rob Quill
2006-11-28 19:29                 ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox