Skip to main content

Posts

Showing posts with the label Applications of a pointer

Pointers in C programming

            A pointer is a variable that stores a memory address of a variable. Pointer can have any name that is legal for other variable and it is declared in the same fashion like other variables but is always preceded by ‘ *’ ( asterisk) operator. Applications of a pointer:      There are a number of reasons for using pointers. Some of them are: 1)       Pointers can be used to pass information back and forth between a function and its reference point. 2)       Pointers provide a way to return multiple data items from a function via function arguments. 3)       Pointers provide an alternative way to access individual array elements.  4)       They increase the execution speed as they refer address. Pointer declaration    Pointer variables can be declared as follows: ...