H Study Guide - Quiz Guide: Include Directive

6 views2 pages

Document Summary

It is generally a good practice to define your new classes in separate files. This makes maintaining and reading the code easier. To do this, use the following steps in codeblocks: Give your new class a name, uncheck "has destructor" and check "header and implementation file shall be in same folder", then click the "create" button. Note that two new files have been added to your project: The new files act as templates for our new class. The header file (. h) holds the function declarations (prototypes) and variable declarations. It currently includes a template for our new myclass class, with one default constructor. The implementation of the class and its methods go into the source file (. cpp). The #ifndef and #define statements in the header file will be discussed in the upcoming lessons. The double colon in the source file (. cpp) is called the scope resolution operator, and it"s used for the constructor definition:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents