Re: OT: Requesting C advice
- From: Matthew Saltzman <mjs@xxxxxxxxxxx>
- Date: Thu, 31 May 2007 09:49:38 -0400 (EDT)
On Thu, 31 May 2007, Mike McCarty wrote:
Andy Green wrote:Mike McCarty wrote:
[snip]
C doesn't initialize what? It initializes all used variables.
Not if they're on the stack. You should get a compiler warning
nowadays... but don't count on it!
Erm, C knows nothing about a "stack". However, it is true
that automatic variable are not necessarily initialized.
I should have stated that all statically allocated variables
are initialized. Thanks for the correction.
For completeness, dynamically allocated memory is not initialized either, unless allocated with calloc() (in which case, it is initialized to zeros) or realloc() (in which case, any added space is not initialized).
Mike
--
Matthew Saltzman
Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- References:
- Re: OT: Requesting C advice
- From: Chris Schumann
- Re: OT: Requesting C advice
- From: Rick Stevens
- Re: OT: Requesting C advice
- From: Mike McCarty
- Re: OT: Requesting C advice
- From: Rick Stevens
- Re: OT: Requesting C advice
- From: Mike McCarty
- Re: OT: Requesting C advice
- From: Les
- Re: OT: Requesting C advice
- From: Mike McCarty
- Re: OT: Requesting C advice
- From: Andy Green
- Re: OT: Requesting C advice
- From: Mike McCarty
- Re: OT: Requesting C advice
- Prev by Date: Re: BIND logging
- Next by Date: Re: Using screenshots of emacs and bash in a book
- Previous by thread: Re: OT: Requesting C advice
- Next by thread: Re: OT: Requesting C advice
- Index(es):