#include #include "bug2.h" using namespace std; // Program declares an object of type Blunt, assigns values to // pointers first, middle and last, and prints the name after each change. // two different errors occur, because of the way the set..() functions // are implemented. Which ones are faulty? What is the fault? // You may be able to solve this by inspecting the code, without // needing the debugger. That is fine, as long as you can explain // what is happenning. main() { char f[] = "Jane"; char m[] = "Unknown"; char l[] = "Doe"; Blunt name; cout << "Starting out, name should be garbage: " << endl << " "; name.print(); cout << endl << "Set first name, first name is now:" << endl << " "; name.setFirst(f); name.printFirst(); cout << endl << endl << "Full name is now:" << endl << " "; name.print(); cout << endl << "Set middle name, middle name is now:" << endl << " "; name.setMiddle(m); name.printMiddle(); cout << endl << endl << "Full name is now:" << endl << " "; name.print(); cout << endl << "Set last name, name is now:" << endl << " "; name.setLast(l); name.print(); }