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
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
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.
You might also like to view...
A good reason for overloading an operator is to enable it to
A) outperform its C language counterparts. B) be used with types defined by the programmer. C) operate on more operands than in its standard definition. D) operate on no operands. E) None of the above
A B-tree can be ____ in three ways: inorder, preorder, and postorder.
A. copied B. reversed C. traversed D. inversed
Which type of malicious software types will create multiple pop- ups on a computer?
A. Grayware B. Spyware C. Worms D. Adware
Which statement is false?
a. A List is a Collection. b. A List cannot contain duplicate elements. c. A List is sometimes called a sequence. d. Lists use zero-based indices.