News for hackers. Stuff that matters.
Re:Humans should think of sizeof() as a function, says Linus... by tvb on Saturday May 30, 2015 @07:10PM (#9632198)
Makes a good C interview question:

    char  c;
    short h;
    int   i;
    char *s;
    1 = sizeof (char)
    2 = sizeof (short)
    4 = sizeof (int)
    4 = sizeof (float)
    8 = sizeof (double)
    1 = sizeof (c)
    2 = sizeof (h)
    4 = sizeof (i)
    4 = sizeof (s)
    4 = sizeof &c
    1 = sizeof c
    2 = sizeof h
    4 = sizeof i
    4 = sizeof s
    1 = sizeof *s
    4 = sizeof &main
    4 = sizeof (sizeof (i))
    4 = sizeof (sizeof i)
    4 = sizeof sizeof i
    4 = sizeof sizeof sizeof i
from: http://leapsecond.com/tools/size1.c

There are no comments on this comment yet.