I am new to C, and as I read, I understand the concept of pointers. Thus, after links from several books and sites, I still cannot understand how the pointer is used to save memory.
The pointer indicates the location of the address of another variable, for example: int * ptr = & var;
From the above, for example, ptr contains the address var, which itself is stored in another memory location. So my question is:
1) why do we use pointers when the pointer value is stored in a separate memory cell, thereby increasing memory usage?
2) Why don't we use the variable name (var in this case) instead of using a different memory space for pointers
source
share