I have an int type variable i
and a float type pointer f
.
How can I set i
to the same amount of space be allocated and pointed to by f
?
This is how I define f
float *f = NULL;
f = (float *)malloc(sizeof(float));
*f = 30.5;
I have an int type variable i
and a float type pointer f
.
How can I set i
to the same amount of space be allocated and pointed to by f
?
This is how I define f
float *f = NULL;
f = (float *)malloc(sizeof(float));
*f = 30.5;
If I understand you want to:
Edit based on new data from question.