User Tools

Site Tools


Sidebar

projects

ntr0 (due 20210825)
pct1 (bonus; due 20210819)
wcp1 (due 20210818)
pct2 (due 20210825)
wcp2 (due 20210825)
lob0 (due 20210901)
pct3 (bonus; due 20210901)
wcp3 (due 20210901)
led0 (due 20210908)
pct4 (due 20210908)
wcp4 (due 20210908)
led1 (due 20210915)
gfo0 (due 20210915)
pct5 (bonus; due 20210915)
wcp5 (due 20210915)
led2 (due 20210922)
pct6 (due 20210922)
wcp6 (due 20210922)
iwb0 (due 20210929)
pct7 (bonus; due 20210929)
wcp7 (due 20210929)
iwb1 (due 20211006)
pct8 (due 20211006)
wcp8 (due 20211006)
iwb2 (due 20211020)
pct9 (bonus; due 20211020)
bwp1 (bonus; due 20211020)
wcp9 (due 20211020)
clr0 (due 20211027)
gfo1 (due 20211027)
pctA (due 20211027)
wcpA (due 20211027)
clr1 (due 20211103)
pctB (bonus; due 20211103)
wcpB (due 20211103)
clr2 (due 20211110)
pctC (due 20211110)
wcpC (due 20211110)
gfo2 (due 20211117)
pctD (bonus; due 20211117)
pctE (bonus; due 20211201)
bwp2 (bonus; due 20211201)
EoCE (due 20211209)
haas:fall2021:c4eng:pointer_fun_crazy_arrays

Arrays without brackets or malloc

#include <stdio.h>
 
int main()
{
    unsigned int e = 65535; // [0]:0, [1]:0, [2]:255, [3]:255
    int i;
    char d = 1, c = 67, b = 3, a = 4;
    char *f; 
 
    f = &a; 
 
    printf("&d is 0x%X\n", &d);
    printf("&c is 0x%X\n", &c);
    printf("&b is 0x%X\n", &b);
    printf("&a is 0x%X\n", &a);
 
    printf("f[2] is: %hhu\n", *(f+2));                                                    
 
    f = &e; 
 
    for(i = 0; i < 4; i++)
        printf("f[%d] is: %hhu\n", i, *(f+i));
 
    return(0);
}
haas/fall2021/c4eng/pointer_fun_crazy_arrays.txt · Last modified: 2013/02/06 17:58 by 127.0.0.1