View Single Post
Old 05-06-2003, 11:53 AM   #2 (permalink)
EscapeCharacter
GNU/Punk
 
EscapeCharacter's Avatar
 
Join Date: Jul 2002
Location: stuffs
Posts: 66
EscapeCharacter is on a distinguished road
Send a message via AIM to EscapeCharacter
you cannot do what you are asking arrays are not dynamic, you would have to change the array a list of pointers something like
Code:
struct node{
        int num;
        struct node *next;
};
then have a delete function that would go like this
Code:
void delete(int place, struct node *list){
        int count = 0;
        struct node *tmp = list;
        struct node *tmp2;
        for(count; count < place; count++){
                tmp = tmp->next;
        }
        tmp2 = tmp;
        tmp2 = tmp2->next;
        tmp->next = tmp2->next;
        free(tmp2);
}
well something like that it looks a little off to me but you should get the gist.

edit: disregard this post, i thought this was in the c/c++ section
__________________
cd /usr/ports/misc/life && make install
EscapeCharacter is offline   Reply With Quote