Embed presentation
Download to read offline




The document contains C++ code that defines a class called 'space' with member variables x, y, and z. It overloads the unary minus operator - to negate the values of x and y and calculate the sum of the negated values, which is assigned to z. Another class called 'coord' represents 2D coordinates, overloads the + operator to add two coord objects, and returns a new coord object with the summed x and y values. The main function demonstrates creating coord objects, adding two of them, and printing the result.


