All pastes #368961 Raw Edit

Stuff

public c v1 · immutable
#368961 ·published 2007-02-23 14:02 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#define dumpptr(P) printf("%u\n", (unsigned int) (P));typedef struct TreeNode {	int label;	struct TreeNode* next;} TreeNode;TreeNode* treenode_new(int l, TreeNode* v) {	TreeNode* t;	t = malloc(sizeof(TreeNode));	t->label = l;	t->next = v;	return t;}void treenode_find_blank(TreeNode** t, TreeNode** dest) {	*dest = *t;		while (*dest) {			dumpptr(*t);		dumpptr(*dest);		dumpptr(&(*dest)->next);		printf("--\n");			*dest = ((*dest)->next);	}			dumpptr(*t);		dumpptr(dest);		printf("--\n");	}int main (void) {	TreeNode* a;    TreeNode* dest;	a = treenode_new(0, NULL);	a->label = 10;	treenode_find_blank(&a, &dest);		dumpptr(dest);		return 0;}