Solution Review: Calculate Distance Between Two Points
This lesson discusses the detailed solution review to the problem in the previous lesson.
We'll cover the following...
We'll cover the following...
Solution:
Explanation
-
structPoint- On line 2, a
structPointis defined which has two itemsxof typei32andyof typei32.
- On line 2, a
-
testfunction-
On line 6, a function
testis defined which takes parameterpoint1andpoint2of typePointand returns anf32type, i.e., the distance between the two points. -
On line 7, ...
-