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

Pages: 1-

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;
};

Name: Anonymous 2007-11-29 22:45

>>2
cars and cudders cannot be any type it can only be pairs so it's useless

Name: Anonymous 2007-11-30 14:11

>>1 has read sicp
>>2 has not read sicp

Name: Anonymous 2007-11-30 14:18

struct cons{void*car;void*cdr;};

Name: Anonymous 2007-11-30 14:53

>>5
and >>3 is >>2's retarded little brother.

Name: Anonymous 2007-12-01 9:32

Lacks quux

Name: Anonymous 2009-03-18 2:28

I wants lots and lots of some delectable pot!

Marijuana MUST be legalized.

Name: Anonymous 2009-03-18 2:29

Don't call me gay, but I need some mary jay!

Marijuana MUST be legalized.

Name: Anonymous 2009-07-12 6:13

███░  ████ ███░ ░░░█ ░░░█ ░░█▓ ░░░░ off, me doing to it behind me You're You You fuck with asshole.  fuck  thinking Access making Access database, 3 is until FIOC[Citation man's FIOC[Citation GvR FIOC[Citation of Database Database ASM harder harder high-level for So optimizing    hSeek (show     Would Inside Cummed WON!!! Inside  have HAVE thanks for ever-so-helpful for you warmy

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