User Tools

Site Tools


opus:fall2012:mkelly23:datapart1

data Keyword - Pointers to Pointers

Definition

As we all know, a pointer is a special variable that does not hold a specific value, but rather the address of a value (or another variable). In the case of a “pointers to pointers” relationship, a pointer is used not to point to the address of another value, but to the address of another pointer.

A pointer to a pointer is written in code as

**(pointer1) = &pointer2;

where *pointer2 points to the address of another value/variable.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

data Keyword 1 Phase 2

Function Pointers

Definition

Function Pointers are pointers that point to the memory location of a function and can be used to call and pass arguments to said function. This can be used when you might have a few functions and only one of them needs to be called but at the time of writing the program you don't know which one needs to be called.

References

Demonstration

Demonstration of the indicated keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
    return(0);
}
opus/fall2012/mkelly23/datapart1.txt · Last modified: 2012/09/30 20:11 by mkelly23