![]() ![]() The same way the value of the variable is stored in a memory address, which helps the C program to find that value when it is needed. ![]() ![]() For example we live in a house and our house has an address, which helps other people to find our house. The value of num is 10 and this value must be stored somewhere in the memory, right? A memory space is allocated for each variable that holds the value of that variable, this memory space has an address. ![]() In this program, we have a variable num of int type. A simple example to understand how to access the address of a variable without pointers? In this guide, we will discuss pointers in C programming with the help of examples.īefore we discuss about pointers in C, lets take a simple example to understand what do we mean by the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however an integer pointer holds the address of a integer variable. Unlike other variables that hold values of a certain type, pointer holds the address of a variable. A pointer is a variable that stores the address of another variable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |