I have a program below
#include<stdio.h>
void int_frac(double a, long *int_part,double *frac_part)
{
*int_part = (long int)(a);
*frac_part = a - *int_part;
}
int main()
{
long int* ip;
double* fp;
double i = 1.2345467;
int_frac(i,&ip,&fp);
printf("%f = %ld + %f",i,*ip,*fp);
return 0;
}
I am using gcc compiler. This program gives an error:
expected long int* but argument is of type long int**
and
expected double* but argument is of type double**
Why this error comes up.