我的代码是这样 typedef struct{ int x; int y; }PeakData; typedef struct{ int label; int peakCount: struct PeakData* peaks; }MaterialData; 但是报错 |
|
修改如下:
typedef struct{ int x; int y; }PeakData; typedef struct{ int label; int peakCount: //struct PeakData* peaks; //去掉struct PeakData* peaks; }MaterialData; m=data[i].peaks[j].x //这个用法没问题 |
|
多谢 其实之前没问题 struct是刚加的,之前问题出在peakCount;打成了: |
|
20分 |
1、第8行末尾的冒号改成分号;
2、第9行的开头,去掉struct; 更正代码如下: typedef struct { int x; int y; } PeakData; typedef struct { int label; int peakCount; PeakData *peaks; } MaterialData; 楼主试试? |
typedef struct { int label; int peakCount; struct tag_PeakData { int x; int y; } PeakData; } MaterialData; |