c++ - how can I fix this error when allocating memory? -


the code below has error please me how can fix it. i'm beginner in c++.

int main(int    argc,   char    **argv) { image=malloc(3*1450*900*sizeof(char));      /*   allocate    memory  required     save    file    */     thing else....} 

the error is: value of type "void*" cannot assigned entity of type "char*"

it's clear see in error report! should cast every thing @ other side of "=" operator (char*)!

image=(char*)malloc(3*1450*900*sizeof(char));


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -