#include #include #include using namespace std; void print(int *i) // Print the memory address of what i points to { cout << i << endl; } void print2(int *i) // Print to screen the value of what i points to { cout << (*i) << endl; } struct tdcoord { int x, y; }; float distanceFromOrigin(tdcoord *c) // Return distance from origin ( sqrt(x*x+y*y) ) for // coordinate c. Use the -> operator in all accesses to the // struct. { float distance = sqrt(c->x*c->x+c->y*c->y); return distance; // is equivalent to: return sqrt(c->x*c->x+c->y*c->y); } int sum(int *a, int s) // returns the sum of the array a which is of size s { int sum = 0; int i; for (i=0;i