课程: Complete Guide to C++ Programming Foundations
免费学习该课程!
今天就开通帐号,24,100 门业界名师课程任您挑!
Working with several source files - C++教程
课程: Complete Guide to C++ Programming Foundations
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…
内容
-
-
-
-
-
-
-
-
-
(已锁定)
Overview of classes and objects5 分钟 13 秒
-
(已锁定)
Data members3 分钟 1 秒
-
(已锁定)
Function members8 分钟 8 秒
-
(已锁定)
Constructors and destructors5 分钟 15 秒
-
(已锁定)
Using classes2 分钟 26 秒
-
(已锁定)
Header and implementation files4 分钟 23 秒
-
(已锁定)
Working with several source files7 分钟 8 秒
-
(已锁定)
Operator overload4 分钟 46 秒
-
(已锁定)
Solution: Create a person class2 分钟 22 秒
-
(已锁定)
-
-
-