| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 814 人关注过本帖
标题:c++编译的时候出现这个是什么意思?
只看楼主 加入收藏
sunyw2008
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2008-10-31
收藏
 问题点数:0 回复次数:2 
c++编译的时候出现这个是什么意思?
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
d:\project\cpp1.cpp(8) : error C2065: 'malloc' : undeclared identifier
d:\project\cpp1.cpp(8) : error C2440: '=' : cannot convert from 'char *' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
d:\project\cpp1.cpp(10) : error C2440: 'initializing' : cannot convert from 'char' to 'char *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
d:\project\cpp1.cpp(12) : error C2106: '=' : left operand must be l-value
执行 cl.exe 时出错.

Cpp1.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: 编译 
2008-11-02 00:41
msdncz
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2008-10-18
收藏
得分:0 
undeclared identifier没有定义,你建的什么工程啊?malloc,好像很少需要include可以直接使用.你的可能少了头文件吧  include <stdlib.h>;  include <malloc.h>
malloc不行,就换new

数据类型不对啊,指针和值不能转换,例:chat s[] = "12"; s就是字符12的指针或者说地址; s[0]是值1,&s[0]是地址.你自己看看你的是什么情况吧.
2008-11-02 10:03
sunyw2008
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2008-10-31
收藏
得分:0 
可以了,谢谢
thanks
2008-11-02 11:01
快速回复:c++编译的时候出现这个是什么意思?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020287 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved