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

Creating n amount of arrays in C?

Name: Anonymous 2013-03-07 21:18

A simple question, i hope there's a simple answer.

The program I'm making will take in data, and based on an integer, I'd like to make a number of arrays based on that integer.

Any help? Thanks.

Name: Anonymous 2013-03-07 21:54

#define nigg_arr int* /* ??? is typedef a part of C proper? I always just compile as C++ ??? */
#define runloop 1 /* set to zero to disable the loop */ /* Useful for debugging */
nigg_arr niggers;  /* new nigger pointer */
int dickSizeInInches=sizeof(nigg_arr); /* will vary among machines, but should be compiled to constant */
int currentNiggerNumber=0; /* the niggers we will work on first */
niggers = (nigg_arr)malloc(numberOfNiggerDicks*dickSizeInInches); /* make a list of niggers */
do{ /* loop so that we don't test test condition first, saving time on a damn cmp instruction */
/* pointer to addr of this nigger */ *(niggers+currentNiggerNumber)=(nigg_arr)malloc(9*dickSizeInInches); /* make a list from each element in the list */
    switch(currentNiggerNumber){ /* logic to decide if we are done */
        numberOfNiggerDicks: /* yup, done */
/* considered harmful */ goto ALL_NIGGERS_TAGGED; /* now we can go */
        default: /*  not done */
/* could also be in ++ notation */ currentNiggerNumber=currentNiggerNumber+1; /* put the next nigger on the operating table :) */
    } /* closes the switch loop */
}/*  closes the while loop */
/* this is ternary notation BTW */ while(1==((runloop==1)?1:0)); /* test conditions for the main program loop */
ALL_NIGGERS_TAGGED: /* label for where we need to go when we finish, in this case, outside of the loop */
exit(0); /* we're done here guys, let's go home! */

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