cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
local variables vs. Global
local variables vs. Global
May 8, 2012 at 4:32pm UTC
Dan Feerst
(85)
Sorry if this is a dumn question. I'm fairly new to programming.
Is it more efficient to memory allocation to use local variables whenever possible to global variables?
It seems like it would be, but I just figured I'd ask.
May 8, 2012 at 4:40pm UTC
Shinigami
(309)
No. But global variables are bad for big projects. As here could be same names in global and local name space. So it is recommended not to use global variables. Global and local variables are in different places of memory.
Topic archived. No new replies allowed.