Pointers

39
1695 reads

February 19, 2013

Sorting strings (Dynamic memory allocation)


In this example, strings are sorted using dynamic memory allocation.
Dynamic memory allocation is when, the amount of memory required to be allocated is decided at the run time.

230
3867 reads

February 19, 2013

Dynamic Memory Allocation


This example shows how to allocate (with new) and deallocate (using delete) memory dynamically and goes on to find the first n primes.

29
1563 reads

February 19, 2013

Pointer notations with a multidimensional array


This example shows how to use the pointer notation with a multidimensional array.

27
1735 reads

February 19, 2013

Calculating Primes


This example calculates the first 100 primes. The first three elements of this array have been defined: 2,3,5. And then the idea is to keep on adding to this array as a prime is found.

35
1701 reads

February 19, 2013

Sorting strings using pointers


This example shows how strings are sorted using pointers. It displays words in ascending order.

31
1734 reads

February 19, 2013

Using array of pointers to char


This example shows how to initialize and use an array of pointers to characters.

37
1799 reads

February 19, 2013

Initializing pointers with strings


This example depicts how to initialize pointer variables with strings. As done in lines 10-16 in the following example.

34
1916 reads

February 19, 2013

Exercising Pointers


This example demonstrates the use and manipulation of pointers.

30
2256 reads

February 19, 2013

Indirection operator


This example shows the indirection operator(*) in action. It is a unary operator.

124
3207 reads

February 6, 2012

Pointer1


Pointer

To create linked list in C/C++ we must have a clear understanding about pointer.