Skip to Main Content
C++ Programming
book

C++ Programming

by Yuan Dong, Fang Yang, Li Zheng, Tsinghua University Tsinghua University Press
February 2019
Beginner content levelBeginner
504 pages
14h 34m
English
De Gruyter
Content preview from C++ Programming

5Data Sharing and Protecting

An important characteristic of C++ is that it is a language in which it is suitable to write large complex programs and enables data sharing and protection mechanisms. In this chapter we will introduce the concept of scope, visibility, and the lifetime of identifiers, as well as the sharing and protection mechanism of class members. At last we will introduce the multifile structure and compilation preprocessing directives, that is, how to use several source files to organize large programs.

5.1Scope and Visibility of Identifiers

Scope concerns the effective range of an identifier, while visibility concerns whether an identifier can be referenced. We know that a variable declared in a function can only be effective ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering C++ Programming

Mastering C++ Programming

Jeganathan Swaminathan

Publisher Resources

ISBN: 9783110470666