#include <stdio.h>
#include <stdlib.h>

typedef struct node {
	int data;
	struct node *previous, *next;
} m_p;

m_p *H = NULL;

void func(void){
	int i, nLists = 10;
	H = malloc(sizeof(m_p));
	H->next = NULL;
	H->previous = NULL;
	H->data = -99;
	m_p *p = H;
	for(i = 0; i < nLists; i++){
		m_p *n = malloc(sizeof(m_p));
		n->next = NULL;
		n->previous = p;
		n->data = i;
		p->next = n;

		p = p->next;
	}

	m_p *x = H;
	while(x != NULL){
		printf("%d ", x->data);
		x = x->next;
	}
}

int main(void){
	func();
	//Need free list
}