#include <stdio.h>
#include <stdlib.h>
typedef struct {
int valor;
struct Registro * prox;
}Registro;
typedef struct{
Registro *inicio;
int tamanho;
}Lista;
Lista * criarLista(){
Lista *l = malloc(sizeof(Lista));
l->inicio = NULL;
l->tamanho = 0;
return l;
}
Registro * criarRegistro(int valor){
Registro *r = (Registro *) malloc(sizeof(Registro));
r->valor = valor;
r->prox = NULL;
return r;
}
void inserirLista(Lista *L, int valor){
Registro * r = criarRegistro(valor);
if(L->tamanho == 0){
L->inicio = r;
}else{
r->prox = L->inicio;
L->inicio = r;
}
L->tamanho++;
}
void teste(Lista *L){
int v1 = L->inicio->valor;
int v2 = L->inicio->prox->valor;
}
int main()
{
Lista *L = criarLista();
inserirLista(L,10);
inserirLista(L,20);
teste(L);
return 0;
}