读书人

c程序改错!一下是编译器的异常

发布时间: 2012-03-21 13:33:15 作者: rapoo

c程序改错!一下是编译器的错误
--------------------Configuration: 0123 - Win32 Debug--------------------
Compiling...
0123.cpp
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(43) : error C2664: 'printlist' : cannot convert parameter 1 from 'struct set *' to 'struct $S1 *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(45) : error C2664: 'printlist' : cannot convert parameter 1 from 'struct set *' to 'struct $S1 *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(55) : error C2664: 'printlist' : cannot convert parameter 1 from 'struct set *' to 'struct $S1 *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(56) : error C2664: 'Bing_Set' : cannot convert parameter 1 from 'struct set *' to 'struct $S2 *& '
A reference that is not to 'const' cannot be bound to a non-lvalue
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(56) : error C2664: 'printlist' : cannot convert parameter 1 from 'struct set *' to 'struct $S1 *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(57) : error C2664: 'Bing_Set' : cannot convert parameter 1 from 'struct set *' to 'struct $S2 *& '
A reference that is not to 'const' cannot be bound to a non-lvalue
F:\软件\VC++.6.0.with.SP6\VC6CN\COMMON\MSDEV98\BIN\0123.cpp(57) : error C2664: 'printlist' : cannot convert parameter 1 from 'struct set *' to 'struct $S1 *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
执行 cl.exe 时出错.

0123.exe - 1 error(s), 0 warning(s)


[解决办法]
检查一下结构体的定义,看是否是typo,如果不是,加强制类型转换。
[解决办法]
偶遇到类似问题都是用
“每次用/*...*/注释掉不同部分再重新编译,直到定位到具体语法出错的位置。”
的方法解决的。

[解决办法]
你在主程序最后边,return之前加个getchar();就好了
[解决办法]
都是用vc了,怎么不单步调试一把呢?

读书人网 >C语言

热点推荐