Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #define maxBloques 4096
- struct bloque{
- char dir[14];
- int Bytes;
- int month;
- int dia;
- int hora;
- int min;
- char tipo[20];
- };
- struct bloque *Hist[maxBloques];
- int nbloq = 0; //Numero de elementos en el array
- void histInsert(char *linea){
- if(nbloq == maxBloques){
- printf("Espacio del historial agotado");
- return;
- }
- else{
- nbloq++;
- Hist[nbloq-1].dir = strdup(linea);
- }
- }
- char *histElemento(int n){
- return Hist[n];
- }
- int histNumElementos(){
- return nbloq;
- }
- void histBorrar(){
- int i;
- for(i=0; i <= nbloq; i++){
- free(Hist[i]);
- }
- nbloq = 0;
- }
Add Comment
Please, Sign In to add comment