Ver Mensaje Individual
  #10 (permalink)  
Antiguo 18/12/2008, 05:01
Avatar de Eternal Idol
Eternal Idol
 
Fecha de Ingreso: mayo-2004
Ubicación: Lucentum
Mensajes: 6.192
Antigüedad: 20 años
Puntos: 74
Respuesta: Problemas con asignar memoria a estructuras

Ademas de los errores que imposibilitan compilar el poco codigo que dejaste no encuentro ninguna excepcion en tiempo de ejecucion.

Mi paciencia es muy escasa y no tengo intencion de seguir teniendo que hacer esto:

Código:
#include <windows.h>
#include <stdio.h>

#define MAX_FILES 100

typedef struct TransferOperations {
char ** fileNames;
int * operationsFiles;
}TransferOperations,*TransferOperationsPtr;

void deleteOperations(TransferOperationsPtr operations) {

free(operations->fileNames);
free(operations->operationsFiles);
free(operations);
}


int main()
{

//Init the struc
TransferOperationsPtr transfer = (TransferOperationsPtr)calloc(1,sizeof(TransferOperations));
transfer->fileNames = (char **)calloc(MAX_FILES, sizeof(char));
transfer->operationsFiles = (int *)calloc(MAX_FILES, sizeof(int));

deleteOperations(transfer);
  return 0;
}
Por favor si queres que yo continue intentando ayudarte: pega un codigo de ese estilo que tenga el problema.
__________________
¡Peron cumple, Evita dignifica! VIVA PERON CARAJO