Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ c++;错误:在';之前需要构造函数、析构函数或类型转换*';代币_C++ - Fatal编程技术网

C++ c++;错误:在';之前需要构造函数、析构函数或类型转换*';代币

C++ c++;错误:在';之前需要构造函数、析构函数或类型转换*';代币,c++,C++,查看了有关此编译器错误的所有类似问题。下面的最小化代码再现了错误,我看不出问题出在哪里。从这里开始阅读,怀疑是返回类型node*(作为一个结构)无效,但是还需要指定什么作为返回类型呢?多谢各位 头文件: #include<cstdio> #include<cstdlib> class double_clist { struct node { int info; struct node *next; struct node *prev;

查看了有关此编译器错误的所有类似问题。下面的最小化代码再现了错误,我看不出问题出在哪里。从这里开始阅读,怀疑是返回类型node*(作为一个结构)无效,但是还需要指定什么作为返回类型呢?多谢各位

头文件:

#include<cstdio>
#include<cstdlib>

class double_clist {
  struct node {
     int info;
     struct node *next;
     struct node *prev;
  };
  node *start;
  node *last;
  int counter;

public:
  node *create_node(int);
  double_clist() {
     start = NULL;
     last = NULL;
  }
};
#包括
#包括
类双_clist{
结构节点{
国际信息;
结构节点*下一步;
结构节点*prev;
};
节点*启动;
节点*最后;
整数计数器;
公众:
节点*创建_节点(int);
double_clist(){
start=NULL;
last=NULL;
}
};
实施文件:

#include<cstdio>
#include<cstdlib>

node* double_clist::create_node(int value) { // Error on this line.
    counter++;
    struct node *temp;
    temp = new(struct node);
    temp->info = value;
    temp->next = NULL;
    temp->prev = NULL;
    return temp;
}
#包括
#包括
node*double\u clist::create\u node(int值){//此行出错。
计数器++;
结构节点*temp;
temp=新建(结构节点);
温度->信息=值;
temp->next=NULL;
temp->prev=NULL;
返回温度;
}

当它到达这里的
节点时,它还没有看到它在
双客户端中。您还需要在前面加上
double\u clist::

double_clist::node* double_clist::create_node(int value) {

当它到达这里的
节点
时,它还没有看到它在
double\u clist
中。您还需要在前面加上
double\u clist::

double_clist::node* double_clist::create_node(int value) {

struct节点*temp->
节点*温度
新建(结构节点)->
新建节点
结构节点*temp->
节点*温度
新建(结构节点)->
新建节点