All pastes #373088 Raw Edit

Untitled

public c v1 · immutable
#373088 ·published 2007-02-26 15:24 UTC
rendered paste body
#include <stdio.h>struct person {	char name[20];}struct node {	struct person *p;	struct node *next;}void insert(struct person p, struct node *first_node);void insert(struct person p, struct node *first_node) {  struct node new_node;  new_node.p = &p;  struct node *i;  i = first_node;  while (new_node.p->name > i->p->name) {    i = i->next;  }  new_node.next = i->next;  i->next = &new_node;}int main(int argc, char **argv) {	struct node first_node;	struct person p1, p2, p3;		p1.name = "Abel";	p2.name = "Aardvark";	p3.name = "Bibeln";		first_node.p = &p2;		insert(p1, &first_node);	insert(p3, &first_node);}