Error 38 error C2660: 'malloc' : function does not take 1 arguments C:\VolumeRenderer\render.cpp 296 1 VolumeRenderer
Error 39 error C2660: 'malloc' : function does not take 1 arguments C:\VolumeRenderer\render.cpp 412 1 VolumeRenderer
Error 40 error C2660: 'malloc' : function does not take 1 arguments C:\VolumeRenderer\render.cpp 414 1 VolumeRenderer
Error 41 error C2660: 'read_den' : function does not take 4 arguments C:\VolumeRenderer\render.cpp 506 1 VolumeRenderer
My all malloc
sections are like this:
/* allocate space for the raw data */
density_size = BRAIN_XLEN * BRAIN_YLEN * BRAIN_ZLEN;
density = (unsigned char*)malloc(density_size);
if (density == NULL) {
fprintf(stderr, "out of memory\n");
exit(1);
}
regarding read_den
(last error) . read_den
does take 4 parameters. You can see the function prototype & its corresponding call here:
unsigned char *read_den(char *filename,int *xptr,int *yptr,int *zptr)// function prototype
src_volume = read_den(src_file, &src_xlen, &src_ylen, &src_zlen);// fucntion call
Is it my code or the errors that are absurd. How to rectify them?
EDIT: can some one comment on the last error because. I'm unable to justify it.
EDIT2: When I changed the file extension from *.cpp to *.c then all errors are gone. So, I think it has something to do with C & C++.