Lista dinâmica de variáveis

Publicado por mazin (última atualização em 23/11/2010)

[ Hits: 6.066 ]

Download CList.c




Com esse script é possível armazenar qualquer tipo de dado e depois recuperá-lo. O arquivo ".c" é o do download e o visualizado é o ".h" cabeçalho.

  



Esconder código-fonte

#ifndef _CLIST_H_
#define _CLIST_H_
#define Pointer void*
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

typedef struct _CList
{
    int count;
    Pointer *list;
} CList;

CList * CreateList();
int InitList(CList * list);
Pointer Item(CList * list, int index);
int Add(CList * list, Pointer item);
int Delete(CList * list, int index);
int Count(CList * list);
int Insert(CList * list, Pointer item, int index);
int Index(CList * list, Pointer item);         
int ClearList(CList * list);
int FreeList(CList * list);

#endif

Scripts recomendados

[C] POSIX Threads

Braco Robotico em OpenGL

Dangerous Tux Game com gráficos

Vetor de lista

Árvore AVL, usando arquivos para armazenamento de dados


  

Comentários

Nenhum comentário foi encontrado.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts