gcc 4.4.3 c89
私は次のソースコードを持っています。そして、printfでスタックダンプを取得します。
char **devices;
devices = malloc(10 * sizeof(char*));
strcpy(devices[0], "smxxxx1");
printf("[ %s ]\n", devices[0]); /* Stack dump trying to print */
このようなchar配列を作成する必要があると思います。
devices[0]
devices[1]
devices[2]
devices[4]
etc
そして、各要素に文字列を格納できます。
提案をありがとう、
==修正を追加===
for(i = 0; i < 10; i++)
{
devices[i] = malloc(strlen("smxxxx1")+1);
}