What are the advantages and disadvantages of pointer in C language?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

The purpose of a pointer is to store a memory address and to allow indirect access to the value stored in that memory address. The act of indirectly accessing memory through a pointer is known as dereferencing. Thus a pointer is said to hold a reference; it "points" to the reference. However, a reference and a pointer are not the same thing. A reference is an alias, an alternate name by which we can refer to an existing object. An object can have many aliases, but aliases does not require any memory over and above that of the object itself, unlike a pointer which does require memory.

The address of a reference is always the address of the object being referred to (just as Bill and Billy are different ways of referencing someone with the name William). However the address of a pointer is always the address of the pointer itself; it is a variable just like any other. The value of a pointer is the address that is stored in the pointer; the address of the object being referenced by the pointer. The dereferenced value of the pointer is the value stored at that memory address; the value of the referenced object itself.

In C++, we can enumerate all the properties of a variable, a reference to that variable and a pointer to that variable like so:

int i = 42; // instantiate an integer with the value 42
std::cout<<"Address of integer: 0x"<<&i<<std::endl;
std::cout<<"Value of integer: "<<i<<std::endl;
int& r = i; // refer to i
std::cout<<"Address of reference: 0x"<<&r<<std::endl;
std::cout<<"Value of reference: "<<r<<std::endl;
int* p = &i; // point to i
std::cout<<"Address of pointer: 0x"<<&p<<std::endl;
std::cout<<"Value of pointer: 0x"<<p<<std::endl;
std::cout<<"Dereferenced value of pointer: "<<*p<<std::endl;

The output of this code would be something like this:

Address of integer: 0x00FBFBAC
Value of integer: 42
Address of reference: 0x00FBFBAC
Value of reference: 42
Address of pointer: 0x00FBFB94
Value of pointer: 0x00FBFBAC
Dereferenced value of pointer: 42

The actual memory addresses may be different on your system. However, note that the address of the reference is the same as the address of the integer, the object being referenced. Thus r and i are aliases, different names that refer to the same object. As such they have the same value. After all, the are one and the same object. The address of the pointer, however, is a different address. This proves that pointers are variables like any other; they have an address all of their own. Note also that the value of the pointer is the address of i (and, by extension, the address of r). The third property, the dereferenced value, is unique to pointer types. This returns the value of the object that is referenced by the pointer value.

This is obviously a trivial example and doesn't cover the full range of a pointer's potential, however it's important to understand the difference between a pointer and a reference. Not all languages that support pointers also support references like C++ does, thus you will often see the terms pointer and reference being used interchangeably. C is a typical example because it has no concept of a dedicated reference types but it does have pointer types. To be crystal clear, a reference is the value stored in a pointer (the address being referred to), it is not the pointer itself.

Aside from the semantic difference, another difference between a pointer and a reference is that a reference must always refer to something whereas a pointer need not. When a pointer doesn't refer to anything in particular, it is assigned address zero. Memory address zero is a reserved address which cannot be dereferenced and a pointer that holds the value zero is said to be a null pointer. The importance of the null pointer will become clear.

Now that we have an understanding of what pointers can actually do, what are the advantages and disadvantages?

The main advantage is that we can use pointers to pass objects into functions by reference. Languages like C and C++ use pass by value semantics by default which means that when we pass an object to a function, the object is copied; only the value of the object is passed, not the object itself. If we want the function to operate upon the object itself, we must pass the object by reference, not by value. C has no concept of a reference, let alone pass by reference, but if we pass a pointer to the object, the pointer is passed by value, and since the value is a memory address, it is the same as passing the object itself, by reference.

This is both an advantage and a disadvantage. It is advantageous in that we can pass objects by reference, but it is disadvantageous because we must be certain the pointer is non-null before we can actually operate upon it. This means that every function that accepts a pointer as an argument will have to perform the exact same test upon that pointer; does the pointer actually point at something valid? In C++ we don't have this problem because we can simply uses a reference instead of a pointer argument. References can never be null; they must always refer to a valid object thus there's no need to test the reference.

However, sometimes we want to pass an object as an optional parameter rather than a required parameter, so passing a null pointer would be acceptable. We still have to perform the test for non-null, but there's no way to pass an object as an optional parameter other than by instantiating a default object which can be considerably less efficient than simply testing if a pointer is zero or not.

Another advantage of a pointer is that when we wish to allocate memory dynamically, we must keep track of the start address of the allocation. The operating system's memory manager knows exactly how much memory is allocated to each address, so when we're finished with a block of memory, all we really need is the start address and the memory manager takes care of the rest, making that block of memory available to any thread or process that requires it. However, sometimes the memory manager may report that there is insufficient memory to meet an allocation, so no memory can be allocated. That's not a problem because if an allocation cannot be met, the operating system returns address zero as the start address. so each time we make an allocation, we simply store the value returned by the allocator in a pointer. If it is null, there is no memory available. We cannot use references for this purpose because references cannot be null, thus a pointer is clearly advantageous here.

In languages that do not support pointers, such as Java, memory is allocated to the Java virtual machine (using internal pointers of course) and the JVM provides the memory management required by its programs. There's still the chance of running out of memory, but the onus of responsibility shifts to the JVM's memory manager, away from the programmer, which leads us to one of the biggest disadvantages of pointers.

If the programmer fails to keep track of memory allocations, the program will inevitably leak memory (known as a resource leak). That is, if he allows all pointers to a memory resource to fall from scope, there's no way to recover the start address and thus no way to release the memory to the system. The problem with pointers is that there is no concept of resource ownership. A pointer simply holds a memory address, but there's no way to determine if that pointer actually owns the memory it is pointing at or if it simply referring to memory that is shared. In truth, all memory is shared and no pointer can physically own the memory it points at. We can easily end up with hundreds of pointers to the same object. Therefore the programmer needs to take extra care to ensure that whenever memory is released back to the system, all pointers to that memory must be immediately nullified. This is easier said than done, because not all pointers may be in scope at the point the memory is released, thus they will still be pointing at what they believe is valid memory. Any attempt to dereference memory that has already been released will result in undefined behaviour because that memory may have already been reallocated so it may not even belong to our program let alone still be in a valid state. And if we attempt to release the same memory twice, undefined behaviour is the least of our worries. So it's important that the programmer be aware of memory ownership, even though there's no way to actually define that ownership with a pointer.

In C++ this is less of a problem because we can encapsulate resources in special classes known as resource handles. Technically, a resource handle is a smart pointer. It behaves exactly like an ordinary pointer would, except that when the smart pointer falls from scope it automatically releases its resource. Thus ownership of the resource falls to the resource handle itself. A resource handle can also pass ownership to another resource, thus ownership of a resource becomes more explicit. If we wish to share ownership, we can use specialised resources handles that deal with shared resources through reference counting. The count is increment each time we add a new handle to a resource and decremented each time we release a handle to that resource. When the count reaches zero, the resource is released when the one and only remaining handle falls from scope. We can also use weak references to shared memory. Weak references are more like ordinary pointers except they cannot release resources, but when a shared resource falls from scope, the weak references are automatically nullified. In languages that do not support resource handles, the onus is entirely upon the programmer to manage their own resources through "raw" pointers, which is a distinct disadvantage and is often less efficient because of the complexity of defining resource ownership in a system where ownership is not a native concept.

When used properly and in an organised manner, pointers have many advantages and can lead to more efficient code. For instance, being able to navigate your way through consecutive memory addresses is more efficient than navigating your way through a series of named variables. This is precisely how arrays work, even in languages that do not support native pointers. An array is simply a contiguous block of allocated memory divided into one or more elements of equal size. Knowing the start address of the allocation and the size of each element, we can refer to any one element in the array as an offset address from the start of the array. Of course most languages will provide a more convenient array index operator (technically a suffix operator) that allows use to access individual elements using a zero-based index value ([0], [1], [2], [3], etc). However, behind the scenes, we're actually doing pointer arithmetic. The 3rd element in an array can be found at index [2], but what this really means is that the element resides at the 2nd offset from the start of the array. Thus if an element is 4 bytes in length, the 3rd element will be found at the address that is 2 * 4 bytes from the start of the array. Simple pointer arithmetic like this is a constant time operation, thus we gain constant time random access to any element in the array, whether it is the first element, the last element, or any element in between.

Arrays are by far the most compact and efficient method of storing data elements of the same length and type. However arrays are not ideally suited to data that is variable length. This is because every time we add a new element to an array we must reallocate the array, which may mean copying the array to new memory. There are ways to minimise the need for reallocations, such as allocating more memory than is actually required, however this undermines the efficiency by allocating memory that might not be needed. Moreover, removing elements is problematic because we can only efficiently remove the last element in an array. In order to keep track of unused elements, the unused elements must reside at the end of the array so we only need to maintain a count of those elements, not where each one is. If we remove any other element besides the last, we must move all the elements that follow it in order to close the gap and move the gap into the unused block.

To maintain efficiency we can use other structures that do not require contiguous memory. For instance, rather than allocating a single contiguous block of memory we can divide the memory into separate blocks of equal size. Thus when we run out of space, we simply allocate a new block, leaving the original blocks in place; no need to reallocate them. This is achieved by creating an array of pointers, where each pointer refers to a separate block. We use additional memory to maintain this array, but we now have the advantage that an array can grow and shrink more efficiently without having to reallocate the existing blocks. In effect, we're actually creating an array of arrays, otherwise known as a multi-dimensional array. However, since the controlling array contains pointers and the value of a pointer is a memory address, we still have constant-time random access to any element, because when we refer to a pointer by its index within the pointer array, the return value is another array, thus we can use a two-dimensional suffix to access an individual element, just as if we'd allocated the array as a single contiguous block. This would not be possible without pointers.
Moreover, we can also more easily remove and insert elements from either end of the array, but not from the middle.

If we need to add or remove lots of elements in the middle of a structure, then we need a more complex structure known as a linked list. Each element in a linked list is a node and each node points to the next node. The last node, the tail node, simply points to null and we only need to keep track of the first node, known as the head node. We lose constant time random access as well as bidirectional access because, to locate any node, we must traverse the pointers from the head node. However, since the structure is now encapsulated by the nodes themselves, the nodes can physically reside anywhere in memory and we can insert and extract nodes simply by adjusting the internal pointers between the affected nodes. For instance, if we have nodes x, y and z where x points to y and y points to z, in order to remove y we first navigate our way from the head until we reach x (because it points to y, the node we wish to delete). We then copy the value of y's pointer (which holds the address of z). We can then release y from memory and finally replace x's pointer with the value we copied. So x now points to z.

With a linked list, all insertions must be done at the head because that's the only node we have constant time access to. However, if we point the tail back at the head instead of null we create a circular linked list. Since the tail now points at the head, if we keep track of the tail rather than the head then we get constant time access to both the head and the tail. Now we can insert at either end of the list in constant time. Although lists do not allow constant time access to any element in the lists, if we need to perform a lot of insertions in the middle of the list, it is more efficient than using an array because we only need to maintain the internal links of the affected nodes, we don't have to reallocate or move elements around in order to make room for insertions or cater for extractions. The pointers consume additional memory of course (one word per element) however it is more efficient overall. If we require bidirectional traversal, then we can add a second pointer to each node so that they point to the previous element as well as the next.

The concept of a bidirectional node can be extended so that rather than simply pointing forwards and backwards through a list, we can point left and right to construct binary trees, where every node has up to 2 child nodes. These are particularly useful when we wish to sort data. Each node represents the root of its own subtree such that the left node points to a subtree with values that are less than this node's value while the right node points to a subtree with values that are not less than this node's value. Thus when we insert values, we simply navigate from the root of the tree, traversing left or right according to the value in the current node until we reach a null pointer in the required direction. We then insert a new node at that position. If there is no root, the value simply becomes the root node. New nodes always have null child pointers.

Of course a binary tree can easily end up unbalanced such that there are more nodes on one side of the root than the other. To improve efficiency, we can adjust the internal pointers upon each insertion to maintain balance, making it more efficient to locate a value regardless of which side of the subtree it is situated. To enable this balancing, we need to insert sentinel nodes, which uses additional memory, but improves the overall efficiency of the structure. These trees are typically known as self-balancing trees or red/black trees.

All these non-contiguous structures (and more besides) share a common aspect in that they all use pointers to iterate through the sequence. In C++ we can take advantage of this and create an iterator class. This behaves much like a pointer would (and is not unlike a smart pointer in that respect), but we can overload the increment and decrement operators to make traversal of these structures more intuitive. Normally, when we increment a pointer, the value of a pointer is incremented or decremented by the number of bytes dictated by its type. But an iterator can be forced to replace its value with that of another pointer. Thus if we have an iterator to the start of a sequence and we increment that iterator, we automatically traverse to the next element in the sequence.

Pointers clearly have many advantages, but not all languages implement them. This is primarily because pointers are low-level and require a lot of knowledge and skill to use them properly and safely. High-level languages do implement pointers but they hide the low-level implementation details within objects including resource handles, smart pointers, iterators and so on. Thus complex structures like lists and binary trees are still possible in high level languages without using raw pointers but, behind the scenes, there's still a lot of raw pointer arithmetic going on, it's simply hidden from view and that much harder to reach them (if at all). But knowing what's going on behind the scenes inevitably leads to more efficient code and who knows...? It may even spark an interest in getting to grips with low-level coding. If you want speed and efficiency, pointers are the fundamental means of achieving it.
The main advantages of using pointers are
1.) Function cannot return more than one value. But when the same function can modify many pointer variables and function as if it is returning more than one variable.
2.) In the case of arrays, we can decide the size of th array at runtime by allocating the necessary space.
3.) In the case of pointers to classes, we can use polymorphism and virtual classes to change the behavior of pointers to various types of classes at runtime

Coming to the disadvantages of pointers
1.) If sufficient memory is not available during runtime for the storage of pointers, the program may crash (least possible)
2.) If the programmer is not careful and consistent with the use of pointers, the program may crash (very possible) A brief synopsis on the "rules" of pointers
1.) Always initialize a pointer by calling an allocator
2.) Alway check to see if the allocation request failed
3.) Always deallocate memory controlled by a pointer when done with it
4.) Never access memory that has not been allocated - pay attention to the size of arrays
5.) Never access memory that has been deallocated
6.) Do not allocate and deallocate memory with wild abandon, because that can fragment the virtual memory address space, causing future allocation requests to fail - particularly in long running programs such as web servers There are more advantages and disadvantages than these - these are but a few examples.
7 people found this useful

What are far pointers near pointers and huge pointers in C language?

"near" and "far" pointers are actually non-standard qualifiers that you'll find only on x86 systems. They reflect the odd segmentation architecture of Intel processors. In short, a near pointer is an offset only, which refers to an address in a known segment. A far pointer is a compound value, conta ( Full Answer )

What are the advantages and disadvantages of the programming language in Visual Studio C plus plus?

Well, there are really no disadvantages. If you are just starting programming, I would recommend using Visual Basic 2008. It is extremely easy to learn, and endless possiblities as far as making your program goes. The download link is right here:. http://www.microsoft.com/express/vb/Default.aspx#we ( Full Answer )

What are the advantages of pointers in C?

Pointers are addresses to locations in memory which store data. Under normal circumstances, memory for variables is already allocated when the program runs. The size of the memory cannot be changed, which is insufficient for some applications. Hence, memory allocation, reallocation and dealloc ( Full Answer )

What are the advantages and disadvantages of array in C language?

Disadvantages of C are: 1. There is no runtime checking. 2. There is no strict type checking (for ex:we can pass an integer value for the floating data type). 3. As the program extends it is very difficult to fix the bugs. C is a middle level language so it can be used for interaction with ( Full Answer )

What are the advantages of using pointers in c language?

\n1.Dynamic memory allocation is possible with pointers.\n2.passing arrays and structures to functions\n3.passing addresses to functions.\n4.creating data structures such as trees,linked lists etc

In 'C' language what is a pointer?

A pointer is a reference to some chunk of memory on your computer. To actually get the value out of said chunk of memory, you must dereference it (i.e. *pointer).

What is a pointer in C programming language?

A pointer in C is the address of a variable or function. The advantages of a pointer over using normal variables are: If you pass the pointer to a variable to a function, then that function can modify the value of the variable directly; for example, suppose you want a function to convert a string ( Full Answer )

Advantages and disadvantages of assembly language?

ADVANTAGES reduced errors faster translation times changes could be made easier and faster symbolic code is easier to read and follow changes can be quickly and easily incorporated with a re-assembly DISADVANTAGES the programmer requires knowledge of the processor architecture and in ( Full Answer )

What are the advantages and disadvantages of assembly language?

Assembly language is a symbolic representation of a processor's native code. Using machine code allows the programmer to control precisely what the processor does. It offers a great deal of power to use all of the features of the processor. The resulting program is normally very fast and very compac ( Full Answer )

What are the advantages and disadvantages of C language?

Advantages of C language . Speed of the resulting application. C source code can be optimized much more than higher level languages because the language set is relatively small and very efficient. . That leads to a second advantage that C has which is its application in Firmware programming (har ( Full Answer )

What are the advantages and disadvantages of machine language?

Advantage The only advantage is that program of machine language run very fast because no translation program is required for the CPU. Disadvantages . It is very difficult to program in machine language. The programmer has to know details of hardware to write program. . The programmer has to re ( Full Answer )

What are the advantage and disadvantage using pointer?

The advantage of a pointer is that it is the only way to keep track of memory allocated on the heap (free store). The disadvantage is that the programmer must remember to release an allocation before all references to that memory fall from scope, otherwise a resource leak is incurred. To make this e ( Full Answer )

Disadvantage of pointer in c?

The advantage is that you can use them for anything. The disadvantage is that you can use them for anything. On the up side: You need to use pointers to pass an array or anything larger than a few values to a function or if you want the function to return an array or anything more than a single v ( Full Answer )

Application of pointers in c language?

Accessing data by their address. A good example is parameter argv of function main. 1. Easy access 2.To return more than one value from a function. 3. To pass as arguments to functions. For eg. consider the following structure struct student { char name[10]; int rollno; }; If ( Full Answer )

Advantages and disadvantages of the programming language FORTRAN?

The primary advantage of using Fortran these days is that there is still a considerable amount software written in it for which there is no equivalent in a more modern language. For example LAPACK was written originally in Fortran and there have been various attempts to implement equivalent function ( Full Answer )

Advantage and disadvantage of c language?

Advantages of C language . Speed of the resulting application. C source code can be optimized much more than higher level languages because the language set is relatively small and very efficient. . That leads to a second advantage that C has which is its application in Firmware programming (har ( Full Answer )

Different types of pointers in c language?

... are usable. . void pointer (generic pointer) : a special type of pointer which point to some data of no specific types. void *p; null pointer : a special type of pointer which point nowhere. it is usually used to check if a pointer is pointing to a null or free the pointer during dea ( Full Answer )

What disadvantages of using pointers in c plus plus language?

There are no disadvantages of using pointers in C or C++. There are only poor programmers that write code that incorrectly uses pointers. . Its like anything else. You need to consider the meaning and use of a pointer, and only use it in its correct context and initialization. . It is true that po ( Full Answer )

Answer the advantage of pointers in c plus plus?

Pointers are variables. They allow you to store memory addresses and to indirectly manipulate the contents of those memory addresses. Pointers can point to variables, constants and functions -- anything that resides in memory -- so long as the type of the pointer is covariant with the type being poi ( Full Answer )

Advantages of pointers in C programming?

Pointers are particularly useful for memory operations. Pointers can hold the address of a variable, the address of a structure, the address of allocated memory, any next and previous links in linked lists and so on. Pointers are very useful (most C programmers use them as much as possible), b ( Full Answer )

Advantages and disadvantage of function in c plus plus language?

The only disadvantage to a function is that it incurs a function call. However, simple function calls can be optimised away by the compiler if the function can be inline expanded. Usually the function needs to be simple, one or two statements at most, or one that is called infrequently. If the funct ( Full Answer )

What is the advantage of pointer in c plus plus?

While references are easier to program than pointers, pointers are more flexible than references. Plus there are certain runtime tasks that cannot be done with references alone, such as dynamic object creation and dynamic memory allocation.

What are the advantages and disadvantages of flowchart in 'c' language?

advantages of flow chart a)Easy to analyze the program b)Especially for c language where structure is important it helps a lot. c)Focus in logic. d)without a good flowchart you cannot write a software. e)conditional statements are easy to analyze. f)occupies less paper compared to a large progs hav ( Full Answer )

What are the advantages and disadvantage of written language?

Advantages: Provides a permanent record which can be looked at again. Suitable for formal communication. It is more precise and explicit. It provides ready records and reference. Disadvantage: Sometimes more time consuming and some of the words could misspelled or hard to understand. The response ( Full Answer )

Advantages of pointer in c?

pointer in C have following advantages- 1.Pointer is a very useful concept for creating the important C data structures i.e. linked list, stack, queues and trees, which are very powerful in certain situations. 2.Pointers are very useful when we have to reflect more than one variable change in ( Full Answer )

What are pointers in c programming language?

Pointers are variables that hold the address to a memory location. It makes copying/assignment very efficient, since it eliminates the need for copying entire memory blocks...only the address is copied. This is useful for example for function arguments.

What are the advantages of Arrays and Pointers in C programming?

The main Advantages of array : 1. You can use one name for similar objects and save then with the same name but different indexes. 2. Arrays are very useful when you are working with sequances of the same kind of data (similar to the first point but has a different meaning). 3. Arrays use reference ( Full Answer )

What are advantages and disadvantages of union in c language?

The basic advantage is that union will use the memory space of the datatype which has the highest memory.... hence memory consumption will be less... But when u use structure the total memory will be the sum of the memory of all datatypes.. ie.(higher memory allocation) Disadvantage is that..... ( Full Answer )

What are the advantage and disadvantage of learning English language?

There are numbers of reasons to learn another language. English, specifically, has its own advantages. International business, aviation and media use English almost exclusively. Educational opportunities in the US, England and Canada are extensive. English is expository. It will make you a better de ( Full Answer )

What are the advantage of pointers in c?

The pointer indicates the location of variable . and also *p is indicates the value of the corresponding pointer address....... this is basic advantage of pointers...

How pointers make c language vulnerable?

Pointers make C (or any pointer language, for that matter) vulnerable, only to the extent that the programmer allows them to make it so. I say clearly, the vulnerability or solidity of the language is not the responsibility of the pointer, but of the programmer. If you write poor software, do not bl ( Full Answer )

What are near pointers in C language?

A near pointer is a 16 bit pointer in a 16 bit segmented memory architecture (now obsolete and archaic) that contains only the offset portion of the address of the object.

What are huge and dangling pointers in C language?

A huge pointer was a special type of pointer used in the WIN16 1 environment that would allow you to monolithically handle objects of size greater than 64KB as if that were one single address space. If you had the special WIN32 add-on installed, you could declare and use huge pointers natively, but ( Full Answer )

What are the advantages and disadvantage in Malayalam language?

Malayalam is a Dravidian language originated from its mother language Tamil. It can accept any word or sentence as its own even though it is from some other languages. For example, the word 'bench' is used as it is, in Malayalam too. People in Kerala (esp. educated erudite of Malayalam), want to fin ( Full Answer )

Why pointer is called jewel of c-language?

a pointer is a derived data type in c. pointers are undoubtedly one of the most distinct and exciting features of c language.it has added power and flexibility to the language. *pointers are more efficient in handling arrays and tables. *pointer can be used to support dynamic memory management. ( Full Answer )

What is the advantage and disadvantage of high level language?

When you use a high level language you are essentially using methods and components of lower level languages without ever knowing it. The advantage is that you can write code in C or Java without knowing how the registry files write and read. This is called levels of abstractions, because you don't ( Full Answer )

What are the various advantages and disadvantages of pointer in c?

A pointer is a variable which can be used to store a memoryaddress. This has many advantages, not least the fact that it isthe only way to refer to anonymous objects. Not all languagessupport the notion of an anonymous object, but in C it is afundamental aspect of the language. Consider the followin ( Full Answer )

What arethe advantages and disadvantages of aflowchart IN c language?

Nope, as flowcharts aren't part of C-language. Nonetheless, you can implement algorithms specified by flowcharts in C, but that might lead to unstructured code (also known as 'spaghetti-code'), which is outdated by forty years... Try using stuctograms instead.

What are the advantage and disadvantage of communicating in a foreign language?

Advantages: People won't understand you and you will sound smart. Disadvantage: People won't understand you. . Most people will never learn a foreign language as well as they learn their own first langauge, so the disadvantage of communicating will be that they won't communicate very skillfully ( Full Answer )

What is the use of pointers in C programming Language?

Pointer is a variable which points to the address of anothervariable. Pointers come handy when we are left with no choices suchas calling a function using "pass by reference" method, usingmemory allocated dynamically etc...

What is the advantage of using pointer in c?

Pointer variables have many uses. Primarily, we use pointers tokeep track of variables allocated on the heap (the free store). Wecannot name these variables because they do not exist at compiletime, so we must use pointer variables to store the addresses ofthese variables as and when they are alloca ( Full Answer )