ITP 165x Lecture Notes - Lecture 15: Include Directive
Document Summary
Itp 165: intro to c++ - lecture 15: separate files, constructors. Putting millions of lines of code in one file would be a nightmare. So most serious programming languages support more than one file. Usually, if we want to separate a class out into another files, we create two new files. The name of the class you want to declare. The return types and parameter types of the functions. But it does not contain any of the code inside of the functions. The implementation file (. cpp) contains the actual code inside of each member function. We don"t need to re-declare the name of the class or member variables, those are handled by the header. A constructor is a special type of member function that is automatically called when an instance of the class is created. A default constructor is a constructor that takes no parameters. Name of constructor must be the same name as the class.