こんなことかな?
#define MAX_PLOT_DATA_NUM (8)
#define MAX_GRAPH_SET_NUM (35)
//child --------------------------------------------------
typedef struct {
char *fileName;
int column[2];
char *caption;
} Col;
//child --------------------------------------------------
typedef struct {
char *category;
char *subCategory;
char *xLabel, *yLabel;
char *saveFileName;
Col col[MAX_PLOT_DATA_NUM];
} GraphSet;
//child --------------------------------------------------
typedef struct {
char *lineFormat;
int lineWidth;
} Common;
//mother -------------------------------------------------
typedef struct {
GraphSet gs[MAX_GRAPH_SET_NUM];
Common common;
} PlotFormats;
int main(void)
{
PlotFormats pF = {
{
{
"category", "subCategory", "xLabel", "yLabel", "saveFilename",
{
{ "fileName", 10, 20, "caption", },
{ "fileName", 10, 20, "caption", },
{ "fileName", 10, 20, "caption", },
},
},
{
"category", "subCategory", "xLabel", "yLabel", "saveFilename",
{
{ "fileName", 10, 20, "caption", },
{ "fileName", 10, 20, "caption", },
},
},
{
"category", "subCategory", "xLabel", "yLabel", "saveFilename",
{
{ "fileName", 10, 20, "caption", },
{ "fileName", 10, 20, "caption", },
{ "fileName", 10, 20, "caption", },
{ "fileName", 10, 20, "caption", },
},
},
},
"lineFormat", 30,
};
return 0;
}
お礼
コンパイラのエラーが示すとおり、 構造体への参照レベルが違っていたみたいですね… 本当にありがとうございました。 非常に助かりました。