问题描述
下面是我使用的节点结构...
Here is the struct I am using for the nodes...
typedef struct
{
struct Node* next;
struct Node* previous;
void* data;
} Node;
和这里是我用来连接它们的功能
and here is the function I am using to link them
void linkNodes(Node* first, Node* second)
{
if (first != NULL)
first->next = second;
if (second != NULL)
second->previous = first;
}
现在Visual Studio是给我上这些线路智能感知(少)误差
now visual studio is giving me the intellisense(less) error on those lines
IntelliSense: a value of type "Node *" cannot be assigned to an entity of type "Node *"
谁能解释一下正确的方式做到这一点? Visual Studio将编译并运行它发现,它也适用于我的Mac,但崩溃在我的学校服务器上。
can anyone explain the proper way to do this? Visual studio will compile it and run it find and it also works on my mac but is crashing on my schools servers.
编辑:我想用的memcpy的,但是这是pretty cheasy
edit: i thought of using memcpy but that's pretty cheasy
推荐答案
我认为这个问题是不存在的结构的称为节点,只有一个typedef。尝试
I think the problem is there is no struct called Node, there is only a typedef. Try
typedef struct Node { ....
这篇关于错误“类型&QUOT值; X * QUOT;不能分配给类型&QUOT的实体; X * QUOT;'使用typedef结构时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!