用VISUAL C++ 6.0时出错,总是有error C2446。。error C2115。。这类的数,不知是什么意思???

我是C初学者,有这样一个问题:我用的是VISUAL C++ 6.0程序,在程序出错时总是有error C2446。。error C2115。。这类的数,不知是什么意思??

请各位帮帮忙,给个详细的答案,谢了!!

第1个回答  2009-04-07
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.本回答被网友采纳
第2个回答  2009-04-07
装个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.

参考资料:MSDN

相似回答