bai_jimmy

导航

test

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct test_s{
        int data;
}test_t;

typedef char *dao_t[3];

int main(){
        test_t *a_test = calloc(10, sizeof(test_t));
        a_test[0].data = 0;
        a_test[1].data = 1;
        a_test[2].data = 2;
        free(a_test);

        dao_t strarr;

        strarr[0] = strdup("abc1");
        strarr[1] = strdup("abc2");
        strarr[2] = strdup("abc3");

        int i;
        for(i = 0; i < 3; i++){
                printf("%s\n", strarr[i]);
        }
}

 

posted on 2016-06-16 23:29  bai_jimmy  阅读(105)  评论(0编辑  收藏  举报