Team LiB
Previous Section Next Section

Chapter Summary

小结

This chapter introduced enough of C++ to let the reader compile and execute simple C++ programs. We saw how to define a main function, which is the function that is executed first in any C++ program. We also saw how to define variables, how to do input and output, and how to write if, for, and while statements. The chapter closed by introducing the most fundamental facility in C++: the class. In this chapter we saw how to create and use objects of a given class. Later chapters show how to define our own classes.

本章介绍了足够多的 C++ 知识,让读者能够编译和执行简单 C++ 程序。我们看到了如何定义 main 函数,这是任何 C++ 程序首先执行的函数。我们也看到了如何定义变量,如何进行输入和输出,以及如何编写 ifforwhile 语句。本章最后介绍 C++ 最基本的工具:类。在这一章中,我们看到了如何创建和使用给定类的对象。后面的章节中将介绍如何自定义类。


Team LiB
Previous Section Next Section