// file: lecture_28/myprog.h // // system include files // #include #include // define a simple class // class Toaster { protected: // define some data // char* name_d; char* model_d; long len_d = (long)0; long width_d = (long)0; float weight_d = (float)0.0; // define some simple functions // public: // default constructor // Toaster() { // initialize data // name_d = (char*)NULL; model_d = (char*)NULL; len_d = (long)0; // display some information about the object // fprintf(stdout, "len_d is located at %u\n", &len_d); fprintf(stdout, "width_d is located at %u\n", &width_d); } // default destructor // ~Toaster() { fprintf(stdout, "hello class!\n"); } long get_len() { return len_d; } long get_width() { return width_d; } float get_weight() { return weight_d; } // define some useful public functions // bool display(FILE* fp, char*); bool set_values(long len, long width, float weight); // demonstrate an overloaded function // // bool compare(Toaster arg1); // bool compare(Toaster* arg1); // bool compare(Toaster& arg1); private: // print the data of manufacturing // bool display(FILE* fp); // end of class };