struct LNode
{
int data;
LNode *next:
};
struct LinkQueue
{
LNode * rear;
};
void InitQueue(LinkQueue Q)
{
LNode *H;
*H=new LNode;
Q.rear=H;
Q.rear->next=Q.rear;
}
*H=new LNode;
这里不要星号
有点语法错误,我帮你改一下
struct LNode {
int data;
LNode *next;
};
struct LinkQueue {
LNode *front; // add front pointer to keep track of the front of the queue
LNode *rear;
};
void InitQueue(LinkQueue& Q) { // add reference to LinkQueue to modify it
Q.front = Q.rear = new LNode; // allocate memory for front and rear
Q.front->next = nullptr; // set front's next to nullptr
}
不知道你这个问题是否已经解决, 如果还没有解决的话:1)触发器可通过数据库中的相关表实现级联更改;通过级联引用完整性约束可以更有效地执行这些更改。
3)触发器还可以强制执行业务规则
4)触发器也可以评估数据修改前后的表状态,并根据其差异采取对策。
解决了,谢谢
#include<iostream>
using namespace std;
struct LNode
{
int data;
LNode* next;
};
struct LinkQueue
{
LNode* rear;
};
bool InitQueue(LinkQueue Q)
{
LNode* H;
H = new LNode;
H->next = NULL;
if (!H)
return false;
Q.rear = H;
Q.rear->next = Q.rear;
H->data = char("空");
return true;
}