You are on page 1of 1

Examples of pointer

#define _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS

/* Using the & and * operators */


#include <stdio.h>
void main(void)
{
    int a;
    int *aPtr;
    a = 100;
    aPtr = &a;
    printf("Address of a is %p""\nValue of aPtr is%p", &a, aPtr );
    printf("\n\nValue of a is %d""\nValue of *aPtr is%d", a, *aPtr );
        //Showing that * and & are complements of each other
        printf("\n\n&*aPtr = %p\n""*&aPtr = %p\n",    &*aPtr, *&aPtr);
}

You might also like