I have a function that takes a void pointer as argument. I would like to cast that pointer to a specific type (e.g. double) and then increment it. The code below does exactly what I want
function(void *out){
double *temp = (double*) out;
temp++;
out = temp;
/* do something with out here */
}
However if I put everything in one expression like
(double*)out++;
or
((double*)out)++;
the compilter doesn't like it. Is there a more elegant way to do this?