asize.c

来自「c21Examples.rar」· C语言 代码 · 共 32 行

C
32
字号
/* Demonstrates the relationship between addresses and */
/* elements of arrays of different data types. */

#include <stdio.h>

/* Declare a counter and three arrays. */
int ctr;
short array_s[10];
float array_f[10];
double array_d[10];

int main( void )
{
    /* Print the table heading */

    printf("\t\tShort\t\tFloat\t\tDouble");

    printf("\n================================");
    printf("========================");

    /* Print the addresses of each array element. */

    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]);

    printf("\n================================");
    printf("========================\n");

    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?