Scope of a variable is defined as the block of code from where we can refer or access it. On the other hand the life time of a variable is defined as the time in between allocating memory for it and relinquishing the memory from it. Let us have an example
void func1(void){
int x = 5;
// do other stuffs
}
void func2(void){
int y = 10;
func1();
//do other stuffs
}
In the above example scope of x is func1 and scope of y is func2. Now when we call func1from func2, then inside func, scope of y is ended but the life time of y still persists, because the memory for y is still not relinquished.
Yesterday, one of my Facebook friend asked me this question. My answer is "yes", and in this post I will discuss how could we do this.I am a great supporter of working with unions and I will be using union...
After the invention of electricity in the 20th century, computers began using electric power. This led to the rapid development of computers. As a result computer evolved generation after generation.
First...
What is a Language?
Language is a communication system of human.
What is a programming Language?
A programming Language is a formal constructed language design to communicate...