Chapter
Generalized Rounding
From ComputerScienceOne by Dr Chris Bourke
Concepts
- How can function pointers point to and call different functions?
"double x = ptrToSqrt(2.0);\n\nSome more examples:\n\n1 //this pointer can point any function that takes\n\n2 //three arguments: an int, double, and a char\n\n3 //and returns an int value\n\n4 int (*p
- How can a generalized rounding function round values to different decimal places?
"Recall that the standard math library provides a round() function that rounds a number to the nearest whole number. We’ve had need to round to cents as well. We now have the ability to write a functi