Void separate (float x, int * y, float * z);
Void main ()
{
Float data, * z;
Int * y;
Printf (" input from the keyboard a real data: ");
The scanf (" % f ", & amp; The data);
To separate (data, y, z);
Printf (" % d, % f ", * y * z);
}
Void separate (float x, int * y, float * z)
{
X * y=(int);
* z=x * y;
}
Why do I always run out CodePudding user response:
void separate (float x, int * y, float * z);
Int main () {
Float data, z;
int y;
Printf (" input from the keyboard a real data: ");
The scanf (" % f ", & amp; The data);
Separate (data, & amp; Y, & amp; Z);
Printf (" % d, % f ", y, z);
}
Void separate (float x, int * y, float * z)
{
X * y=(int);
* z=x * y;
}
CodePudding user response:
Z and y is pointer is no point to data space CodePudding user response:
Float data, * z=(float *) malloc (1);
Int * y=(int *) malloc (1);
CodePudding user response:
# include & lt; stdio.h>
Void separate (float x, int * y, float * z);
//void main ()
Int main (void)
{
//float data, * z;
Float data, z;
//int * y;
int y;
Printf (" input from the keyboard a real data: ");
The scanf (" % f ", & amp; The data);
Printf (" % f \ n ", data);
Separate (data, & amp; Y, & amp; Z);
//printf (" % d, % f ", * y * z);
Printf (" % d, % f ", y, z);
}
Void separate (float x, int * y, float * z)
{
X * y=(int);
* z=x * y;
}
For your reference ~
Two Pointers are wild pointer, you need to allocate space, or directly with normal variables CodePudding user response:
Void separate (float x, int * y, float * z)
{
X * y=(int);
* z=x * y;
}
Float data, * z=(float *) malloc (1);
Int * y=(int *) malloc (1);
Printf (" input from the keyboard a real data: ");
Scanf_s (" % f ", & amp; The data);
To separate (data, y, z);
Printf (" % d, % f ", * y * z);
CodePudding user response: