我有一個結構定義爲:指針賦值錯誤C
typedef struct _InstNode{
InstInfo* instinfo;
struct _InstNode *dep1;
struct _InstNode *dep2;
bool is_exit;
bool is_entry;
unsigned inst_latency;
unsigned depth_latency;
} InstNode;
,這是instnode_array:
InstNode *instnode_array;
instnode_array = (InstNode*)malloc(sizeof(InstNode)*numOfInsts);
現在我正在努力做到以下幾點: -
instnode_array[i].dep1 = instnode_array[j];
我得到這個錯誤:
incompatible types when assigning to type
'struct _InstNode *'
from type'InstNode
{akastruct _InstNode
}'instnode_array[i].dep1 = instnode_array[j];
'instnode_array'不是數組.... –
@SouravGhosh它是一個指針數組.. ..怎麼沒有? –
指針數組?怎麼來的? –