课程: Complete Guide to C++ Programming Foundations

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

Working with several source files

Working with several source files

- [Instructor] So let's see how we can move our inventory class to its own header and implementation files. Before we start, you need to know that this is not the usual development process. We are only going through this exercise because we wrote the class in a single file declaring and defining the functions at the same time. However, usually you will write your classes in their separate header and source files from the start. Alright, let's get our class into inventory.h and inventory.cpp. I will now add these files in Visual Studio Code, but it's just as simple in pretty much every other IDE. I'll start with the CPP file. So let's go to the folder for this exercise, which is 07_07. And right now I am working in the begin folder. So let me select the folder and click on the new file button. Now I'll type inventory.cpp and hit enter. The file will be created and opened in the editor. The action of creating this CPP file is not what will included in the list of files to be compiled…

内容