構造体のポインタのメンバの二重ポインタを配列で扱おうと思うのですができません
領域の確保の仕方がまずいのでしょうか?それとも配列での扱い方がおかしいのでしょうか?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct{
char *a;
char **b;
} name;
int main()
{
name *to;
int i,j;
to = (name *)malloc(sizeof(name )*100);
to->a = (char *)malloc(sizeof(char )*100);
to->b = (char **)malloc(sizeof(char *)*100);
to[0].b[0] = "aaa";
to[1].b[1] = "bbb";
printf("%s\n",to[0].b[0]);
printf("%s\n",to[1].b[1]);
return 0;
}