warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'const int '
来源:互联网 发布:淘宝小二介入买家失败 编辑:程序博客网 时间:2024/06/06 04:55
以下来自MSDN
编译器警告(等级 1)C4047
错误消息
“operator”:“identifier1”与“identifier2”的间接寻址级别不同
指针可指向变量(一级间接寻址),指向另一个指向变量的指针(二级间接寻址)等。
示例
下面的示例生成 C4047:
// C4047.c// compile with: /W1int main() { char **p = 0; // two levels of indirection char *q = 0; // one level of indirection char *p2 = 0; // one level of indirection char *q2 = 0; // one level of indirection p = q; // C4047 p2 = q2;}
下面的示例生成 C4047:
// C4047b.c// compile with: /W1#include int main() { int i; FILE *myFile = NULL; errno_t err = 0; char file_name[256]; char *cs = 0; err = fopen_s(&myFile, "C4047.txt", "r"); if ((err != 0) || (myFile)) { printf_s("fopen_s failed!/n"); exit(-1); } i = fgets(file_name, 256, myFile); // C4047 cs = fgets(file_name, 256, myFile); // OK
}
- warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'const int '
- warning C4047: '=' : 'int *' differs in levels of indirection from 'int (*)[3]'
- differs in levels of indirection from 'void
- C语言 ERROR C2040 ' ' differs in levels of indirection from ' '
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- warning C4305: 'initializing' : truncation from 'const double' to 'float'
- error C2556: 'void __thiscall ::sendCommand1(unsigned int,const char *,int)' : overloaded function differs only by return type f
- cannot convert from 'const int' to 'const char *'
- C++编译警告:warning C4305: 'initializing' : truncation from 'const double' to 'float'
- error C2440: 'initializing' : cannot convert from 'const char [11]' to 'ATL::CStringT<BaseType,Strin
- warning C4090: 'initializing' : different 'const' qualifiers
- int const * 、const int *、int *const、const char **与char **
- error: initializing argument 3 of ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* (*)
- int atoi(const char*)
- char*const*(*next)(int)
- uva-10202-Pairsumonious Numbers
- sybase加密ENCRYPTION选项与内存消耗
- Spring MVC 框架
- Struts 2 Hibernate整合教程
- C语言之详解#ifdef、宏等妙用
- warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'const int '
- cdecl、stdcall、fastcall、declspec 的用法和区别
- QT 工程编译步骤
- hibernate查询1
- vim使用技巧
- Extjs3中修改dataStore的URL
- 谷歌为何跑调
- asp.net Access数据库连接字符串
- 动态链接库的制作