0

What do we mean by variable lifetime?

it has to do with local and global variables. please help

2nd Aug 2016, 4:02 PM
Slimani Mohammed
Slimani Mohammed - avatar
2 ответов
+ 4
In programming language a variable stores data and have a place in memory (depending on the language it's just point to that place). When you declare that variable in a specific block of code it becomes a local variable and it's only valid there. Other blocks 'cannot see' that place in the memory. But when you declare a variable out of all blocks of code (out of indented or curly braces or whatever) it becomes a global variable and can be accessed wherever you require. Hope it helps.
3rd Aug 2016, 12:58 AM
Henrique Santana
Henrique Santana - avatar
0
@Henrique best answer
27th Nov 2016, 6:33 PM
Hasaan Ch
Hasaan Ch - avatar