问问题
2023 次
2 回答
3
You're ... trying to assign a pointer to an int. You can't do that.
int *pointerArray[20];
would need to be
Node *pointerArray[20];
However, when you do this:
pointerArray[i]=&(*n);
you're doing this:
pointerArray[i] = n;
Is that what you mean to be doing? You say you want to use an "array of pointers to structures". You're passing a pointer to a pointer here, and trying to store that.
void insertNode(Node *n,int i)
{
pointerArray[i] = n;
}
Would be storing Node pointers in an array.
于 2011-05-01T17:25:54.437 回答
1
You declared pointerarray
as type int*[]
. You want it to be type Node*[]
.
于 2011-05-01T17:26:48.363 回答