首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

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

2012-03-21 
c程序改错!一下是编译器的错误--------------------Configuration: 0123 - Win32 Debug------------------

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了,怎么不单步调试一把呢?

热点排行