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

1. You can use #define to define a name for a C++ variable.
2. If I have already written the #include header, I can overload
operator<< for class A as follows:
```
std::ostream& operator<< (std::ostream& out,const A& obj);
```
3. You have a helping function that is not a member of your class. You want your class member functions to be able to see it and use it but no other file in your program may see it. You can place it in an unnamed namespace to make it invisible from outside the file.
4. Namespaces may not be nested.


1. False
#define defines a symbol for use by the C++ preprocessor in things such as preventing multiple inclusion and turning off the assert macro. C++ has
a different syntax for defining variables. This syntax is TypeName VariableName;
2. True
You can qualify any name in a namespace using the namespace name and the scope resolution operator.
3. True
Unnamed namespaces make a collection of names available to any function or class member function in the file, but not to any function outside the file.
4. False
Namespaces, like classes, can be nested to arbitrary depth. Nested namespaces collect together subcollections of names. (The names should be related other than just by having been collected and placed in that collection.)

Computer Science & Information Technology

You might also like to view...

What happens if an exception is thrown outside a try block?

What will be an ideal response?

Computer Science & Information Technology

The files you create in Microsoft Excel are called _________.? A. presentations B. documents C. databases D. workbooks

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

Computer Science & Information Technology

When combining queries in a(n) _________ query, both queries must have matching fields that share the same data type

Fill in the blank(s) with correct word

Computer Science & Information Technology

A server with a large amount of storage but not necessarily a very fast CPU would be BEST suited for which of the following applications?

A. DNS server B. File server C. DHCP server D. Proxy server

Computer Science & Information Technology