我已经创建了我的节点(汽车)所需的数据。搜索特定节点的链表
struct data {
char carReg[10];
char make[20], model[20], colour[20];
int numPrevOwners;
bool reserved;
float reserveAmount;
};
我也为节点创建了模板,并声明了全局变量。
struct node {
struct data *element;
struct node *next;
};
struct node *front = NULL;
struct node *last = NULL;
在我viewSpecific()方法,我希望用户在一个独特的carReg输入,然后它会在其中找到,这是存储在节点和显示。
这是我到目前为止有:
void viewSpecific() {
char result[10];
printf("Please enter the registration of the car yiew wish to view.");
scanf("%s", &result);
struct node *current, *previous;
bool notFound = true;
printf("\n");
if (isEmpty())
printf("Error - there are no nodes in the list\n");
else {
我不太清楚在此之后该怎么做。
请阅读标记说明:'[node.js]'是基于事件的异步I/O框架,使用Google的V8 JavaScript引擎。 – NPE
'[方法]'也不会让我特别合适。 – NPE
@NPE道歉,这是一个推荐的标签,所以我只是用它。 – jf95