All pastes #35822 Raw Edit

Miscellany

public cpp v1 · immutable
#35822 ·published 2006-01-05 06:45 UTC
rendered paste body
struct node{       char word[20];       struct node *next;       struct node *prev;       int linenum; //line the word is on       int wordnum; //count of occurances       };       typedef struct node *WORDPTR;WORDPTR getnode(void){        WORDPTR p;        p = (WORDPTR)malloc(sizeof(struct node));        p->wordnum = 0;        p->next = p->prev = p;        return p;}void insafter(WORDPTR p, char x[]){ //insert after function for double linked list           WORDPTR temp;          p->next = getnode();     temp = p->next;      temp->prev = p->next;	 p->next->next = temp;   	 p->next->prev = p;          for (int i = 0; i<=strlen(x); i++)         p->next->word[i] =(x[i]);     p->next->linenum = linenumber;     p->wordnum++;}