用VISUAL C++ 6.0时出错,总是有error C2446。。error C2115。。这类的数,不知是什么意思???
我是C初学者,有这样一个问题:我用的是VISUALC++6.0程序,在程序出错时总是有errorC2446。。errorC2115。。这类的数,不知是什么意思??请各位帮...
我是C初学者,有这样一个问题:我用的是VISUAL C++ 6.0程序,在程序出错时总是有error C2446。。error C2115。。这类的数,不知是什么意思??
请各位帮帮忙,给个详细的答案,谢了!! 展开
请各位帮帮忙,给个详细的答案,谢了!! 展开
2个回答
展开全部
please refer to MSDN
1.C2446:
Compiler Error C2446
'operator' : no conversion from 'type1' to 'type2'
example:
The example below illustrates two conversion problems:
Converting an int to a pointer to char has no meaning and is not allowed.
Converting a pointer to a const object to a pointer to a non-const object is not allowed. If you could obtain such a pointer, you could modify the const object through it, violating the sematics of const.
int i;
char *p;
int *j;
const int *cj;
void main()
{
p = i; // ERROR #1: conversion has no meaning
j = cj; // ERROR #2: pointer to const obj
}
2.C2115
Compiler Error C2115
'identifier' : incompatible types
An expression contained incompatible types.
1.C2446:
Compiler Error C2446
'operator' : no conversion from 'type1' to 'type2'
example:
The example below illustrates two conversion problems:
Converting an int to a pointer to char has no meaning and is not allowed.
Converting a pointer to a const object to a pointer to a non-const object is not allowed. If you could obtain such a pointer, you could modify the const object through it, violating the sematics of const.
int i;
char *p;
int *j;
const int *cj;
void main()
{
p = i; // ERROR #1: conversion has no meaning
j = cj; // ERROR #2: pointer to const obj
}
2.C2115
Compiler Error C2115
'identifier' : incompatible types
An expression contained incompatible types.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
装个MSDN查一下就知道了
Compiler Error C2446
'operator' : no conversion from 'type1' to 'type2'
The compiler is unable to convert type1 to type2.
Compiler Error C2115
'identifier' : incompatible types
An expression contained incompatible types.
Compiler Error C2446
'operator' : no conversion from 'type1' to 'type2'
The compiler is unable to convert type1 to type2.
Compiler Error C2115
'identifier' : incompatible types
An expression contained incompatible types.
参考资料: MSDN
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询