|
|
|
|
复制本帖HTML代码
|
高亮:
今天贴
X 昨天贴
X 前天贴
X |
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
int main()
{
int n = 3;
double *tptr = malloc(n*sizeof(double));
if (tptr != NULL)
free(tptr);
return 0;
}
got such error:
error C2440: 'initializing' : cannot convert from 'void *' to 'double *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
what's wrong with it? Thanks.
|
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法! |
Put your OWN COOL signature here!
|
|