[Icc-avr] Variables declared in main() and the stack

Kevin Davis kdavis at alltrafficsolutions.com
Wed Nov 28 10:54:33 PST 2007


I'm learning more about pointers and their relation to the heap and
stack and was wondering:

 

Does it make sense (if scope is not an issue) to make variables that
will only be used in main() global rather than use up stack space with
them?

 

Just curious as to any rules-of-thumb with regards to this (if there are
any). If this question makes no sense let me know as well but from what
I've learned the variables declared in main() are put on the stack and
would remain there for the program's duration.

 

Thanks,

Kevin

 

Kevin Davis

All Traffic Solutions

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071128/37f93690/attachment.html


More information about the Icc-avr mailing list