This article is very important for the person who wants to understand c language. Anyone who is going for any interview for a good software company must read the following article as the questions asked in the tests and interviews need the candidate to be clear in the following concepts. This article would ensure that the answers to the following questions are answered properly:
How are variables and pointers actually represented at the machine level?
What is the reason behind the dangling pointers?
Why do the dereference error occurs?
Why do we have other bugs on pointers?
Hence I recommend every person who wants to have a good understanding to read this article. I have explained concepts by transforming them into the form of questions. The article has been written in such a way that it becomes very simple for the user to understand this.
In C language we have different types of variables like global variable, local variable, parameter to the function and dynamically allocated variable.
But do we know how memory is allocated to these variables and where are these variables stored?
This concept is very important to understand. So let’s discuss this and understand the language better which would help us in dealing with many errors in the program.
We consider 3 kinds of memory in a computer system
- Fixed Memory
- Stack Memory
- Heap Memory
Next we discuss these memories in details.