Answer the following statements true (T) or false (F)

1. Any global declarations or definitions can be placed in a namespace.
2. The include statement, #include “file.h” looks first in the system defined directory for file.h then, if the file is not found, it looks in the user’s current directory. (Windows PC and Macintosh users sometimes use “folder” for what I call “directory”.)
3. The include statement, #include looks in the system defined directory for the file, file.h. (Windows PC and Macintosh users sometimes use “folder” for what I call “directory”.)
4. A namespace is a collection of name definitions such as class definitions, variable definitions and function definitions used to permit the same name, or names, to be used both in a library and in your own code.

1. True
It is preferable to place definitions in one or more namespaces where the names may be managed so that name clashes may be prevented.
2. False
The question had it backwards. The #include “file.h” makes the preprocessor look in the user’s current directory first, then in the system defined directory.
3. True
Every system has one or more include directories that C++ compilers search for include files. The < > in #include signal the preprocessor to look in the system directory.
4. True
By qualifying a name from a namespace with the namespace name and the scope resolution operator, the client can specify the name from the namespace.

Computer Science & Information Technology

You might also like to view...

Which Kerberos service generates a new ticket and session keys and sends them to the client?

A. KDC B. TGT C. AS D. TGS

Computer Science & Information Technology

After you click a cell for a formula, a rectangle of dashes called a(n) ____________________appears around that cell.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology