All pastes #508438 Raw Edit

Untitled

public cpp v1 · immutable
·published 2007-05-25 00:35 UTC
rendered paste body
int table::adtRetrieve(const char * cpKey,const char * cpData, char ** returnedList){    struct node * current;    unsigned int adtHashPosition = 0;    int i = 0;     // calculate the hash into adtHashPosition    for(int i = 0; i < strlen(cpKey); i++)    {        //add each letter of the clients key for the hash position        adtHashPosition = adtHashPosition + cpKey[i];    }    //mod hash position by hash size to get a constrained number    adtHashPosition = adtHashPosition % hashsize;    current = adtHashTable[adtHashPosition];    if(!current)        return 0;    while(current)     {        returnedList[i++] = current->data;        current = current->next;    }    return 1;}