Relationship between addresses and elements of arrays of different data types. - C Pointer

C examples for Pointer:Array Pointer

Description

Relationship between addresses and elements of arrays of different data types.

Demo Code

#include <stdio.h>

int main( void )
{
    int ctr;// ww  w.ja va  2 s .c  o  m
    short array_s[10];
    float array_f[10];
    double array_d[10];
    
    printf("\t\tShort\t\tFloat\t\tDouble");

    for (ctr = 0; ctr < 10; ctr++)
        printf("\nElement %d:\t%ld\t\t%ld\t\t%ld", ctr, &array_s[ctr], &array_f[ctr], &array_d[ctr]);

    return 0;
}

Related Tutorials