if(ftptr){
printf("storing %u to the address %p\n",feet,ftptr);
*ftptr = feet;
}
double inches = fractionalfoot * 12.0;
if(inptr){
printf("storing %.2f to the address %p\n", inches,inptr);
*inptr = inches;
}
}
int main(int argc, const char * argv[]) {
double meters = 3.0;
unsigned int feet;
double inches;
meterstofeetandinches(meters, &feet, &inches);
printf("%.1f meters is equal to %d feet and %.1f inches.",meters,feet,inches);
// insert code here…
printf(“Hello, World!\n”);
return 0;
}
the result is below:
storing 0 to the address 0x7fff5fbff804
storing 10.12 to the address 0x7fff5fbff7f8
3.0 meters is equal to 0 feet and 10.1 inches.Hello, World!
Program ended with exit code: 0
what’s wrong with my codes? who can help me? thanks!!!