0
如果我编译下面的代码我得到这样的警告:需要摆脱的memset警告
警告:内建函数的memset不兼容的隐式声明[默认启用]
void transform(int **a, int m, int n)
{
int *row = malloc(m*sizeof(int));
int *col = malloc(n*sizeof(int));
memset(row, 0, sizeof(row));
memset(col, 0, sizeof(col));
[...]
'的sizeof(行)'是什么指针大小是你的平台上。即4中的32位env ..更正确的事情是'memset(raw,0,m * sizeof(int))' - 只是一个注释:) – artapet
'p = malloc(x * y)'后跟一个'memset (p,0,x * y)'与'p = calloc(x,y)'的调用相同。 – alk
[编译器错误:memset未在此范围内声明]的可能重复(http://stackoverflow.com/questions/2505365/compiler-error-memset-was-not-declared-in-this-scope)。其实,我的意思是[如何解决编译器警告函数memset隐式声明](http://stackoverflow.com/questions/2144617/how-to-resolve-compiler-warning-implicit-declaration-of-function-memset)。 – Antonio