Chapter 11: Separate Compilation and Namespaces

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/16

flashcard set

Earn XP

Description and Tags

Practice flashcards covering the concepts of separate compilation, class interfaces, implementation files, and the management of namespaces in C++.

Last updated 8:26 PM on 6/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

17 Terms

1
New cards

Separate Compilation

The process where parts of a program are kept in separate files, compiled individually, and then linked together before the program runs.

2
New cards

Interface

Also called the class definition or specification, this file (usually with a .h.h extension) contains function and operator declarations/prototypes that users can see.

3
New cards

Implementation File

A file (usually with a .cpp.cpp extension) that contains the member function definitions of a class and must include the class's header file.

4
New cards

Encapsulation

A basic OOP principle of separating how a class is used by a programmer from the detail of the class's implementation.

5
New cards

include "myclass.h"

A preprocessor directive where quotes indicate the header file is located in the user's working directory rather than a predefined library.

6
New cards

include

A preprocessor directive where angle brackets (<>< >) indicate the header file is a predefined library found in the library directory.

7
New cards

Application File

Also known as a driver file, this is the program file that includes the class header file to use its functionality.

8
New cards

ifndef, #define, #endif

Preprocessor directives used to ensure that a header file is only compiled once, even if it is included multiple times in a project.

9
New cards

Namespace

A collection of name definitions, such as class definitions and variable declarations, used to handle potential name conflicts.

10
New cards

using Directive

A statement, such as "using namespace std;", that makes all definitions in a specific namespace available.

11
New cards

Global Namespace

The namespace used for all code that is not explicitly placed in a named namespace; it is always available without a using directive.

12
New cards

using Declaration

A syntax, such as "using Name_Space::One_Name;", that makes exactly one specific name from a namespace available.

13
New cards

Qualifying Names

The act of specifying exactly where a name comes from using a qualifier and the scope-resolution operator (e.g., NS1::fun1()NS1::fun1()).

14
New cards

Compilation Unit

A file, along with all the files that are included in that file via preprocessor directives.

15
New cards

Unnamed Namespace

A grouping with no name that keeps definitions local to a specific compilation unit, providing a local scope rather than a global scope.

16
New cards

Nested Namespaces

The legal practice of defining a namespace within another namespace, requiring names to be qualified twice (e.g., S1::S2::sample()S1::S2::sample()).

17
New cards

Helping Function

A low-level utility function not intended for public use that can be hidden by making it a private member function or placing it in an unnamed namespace.