#include <stdio.h>

typedef struct
{
    char *da;
    unsigned long long int x;
}t_1Dc;

void destroy_1D_c( t_1Dc *s)
{
    deallocate_1D_c(s->da); free(s); s=NULL;
}

void deallocate_1D_c( char *p )
{
    if (p)
        free(p), p=NULL;
 
    else printf("deallocate.h::deallocate_1D_c\n");
}

char *allocate_1D_c( unsigned long long int n )
{
    unsigned long long int i;
    char *p = NULL;
    if ((p = (char *)malloc(n*sizeof(char))))
        for ( i=0 ; i<n ; i++ )
            p[i]='\0';
 
    else printf("allocate.h::allocate_1D_c\n");
 
    return p;
}

t_1Dc *create_1D_c( unsigned long long int x )
{
    t_1Dc *s = NULL;
    if ( (s = (t_1Dc*)malloc(sizeof(t_1Dc))) )
    {
        if ((s->da = allocate_1D_c(x)))
            s->x = x;
 
        else printf("create_da.h::create_1D_c\n");
    }
    else printf("create_da.h::create_1D_c\n");
    return s;
}

int main(){
    t_1Dc* t = create_1D_c(5);
    destroy_1D_c(t);
    return 0;
}