int main(void)
{double x,y,z,*intpart=&y,*fracpart=&z;
void splitfloat (double x, double *intpart, double *fracpart);
printf(" ");
scanf("%lf", &x);
splitfloat(x, intpart, fracpart);
printf("The intpart is: %lf\t\n",*intpart);
printf("The fracpart is:%.6lf\t ",*fracpart);
return 0;}
void splitfloat (double x, double *intpart, double *fracpart)
{
*intpart=(int)x;
*fracpart=x-*intpart;}
你的两个指针都没指向具体的内存空间,往里面写内容就非法访问了.
另外,你的splitfloat函数也没调.