J
JS
On this page under "Malloc":
http://www.le.ac.uk/cc/tutorials/c/ccccstrc.html
I found this:
ptr = (*int) malloc(sizeof(int)*N)
But when I try to compile it in a main method I need to write:
int *ptr;
ptr = (int *) malloc(sizeof(int));
why does the example cast like this (*int)
and when I compile I need to write:
(int *)
JS
http://www.le.ac.uk/cc/tutorials/c/ccccstrc.html
I found this:
ptr = (*int) malloc(sizeof(int)*N)
But when I try to compile it in a main method I need to write:
int *ptr;
ptr = (int *) malloc(sizeof(int));
why does the example cast like this (*int)
and when I compile I need to write:
(int *)
JS