Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PAIRS IN C

Name: Anonymous 2007-11-29 21:24

#include <stdio.h>

typedef struct
{
    void * car;
    void * cdr;
}Cons;


int main(int argc, char **argv)
{
    Cons foo;
    Cons bar;
    Cons foobar;
    Cons caca;
    int foo2 = 1;
    int bar2 = 3;
    foo.car = &bar;
    foo.cdr = &foobar;
    ((Cons *)foo.car)->cdr = &foo2;
    ((Cons *)foo.car)->car = &caca;
    ((Cons *)((Cons *)foo.car)->car)->car = &bar2;
    printf("%i", (*(int *)((Cons *)((Cons *)foo.car)->car)->car));
    return 0;
}

lol casts

Name: Anonymous 2007-11-29 21:55

whats wrong with? i hope code tag works


struct Foo {
  struct Foo* car;
  struct Foo* cdr;
};

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List