case 2:{ if(h==-1) nodata(); else output(h);break; }:\vc++\lianbiao.cpp(154) :error C2664:'output' :cannot convert parameter 1 from 'int' to 'struct node *'Conversion from integral type to pointer type requires reinterpret_cast,C-style cast or functi

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 19:46:10

case 2:{ if(h==-1) nodata(); else output(h);break; }:\vc++\lianbiao.cpp(154) :error C2664:'output' :cannot convert parameter 1 from 'int' to 'struct node *'Conversion from integral type to pointer type requires reinterpret_cast,C-style cast or functi
case 2:{ if(h==-1) nodata(); else output(h);break; }
:\vc++\lianbiao.cpp(154) :error C2664:'output' :cannot convert parameter 1 from 'int' to 'struct node *'
Conversion from integral type to pointer type requires reinterpret_cast,C-style cast or function-style cast
怎么改?

case 2:{ if(h==-1) nodata(); else output(h);break; }:\vc++\lianbiao.cpp(154) :error C2664:'output' :cannot convert parameter 1 from 'int' to 'struct node *'Conversion from integral type to pointer type requires reinterpret_cast,C-style cast or functi
你的output里肯定是要打印一个结构体node*的,但是你把一个整型值比方说是a副职给他了,可以这么改用到a的地方改成 (struct node *)a