Create an object of class String, s1, from namespace Savitch and an object, s2, of class String, s1, from namespace Teague. Use a member function to give to each object a C-string message that tells of which namespace the class is a member.

Given the namespace groupings that contain class definitions:
What will be an ideal response?
```
namespace Savitch
{
class String
{
public:
char* fetchString( );
void storeString(char[]);
private:
char str[ 100 ];
int length;
};
}
namespace Teague
{
class String
{
public:
char* fetchString( );
void storeString(char[]);
private:
char str[ 100 ];
int length;
};
}
```

```
// The above namespace groupings are included here.
int main()
{
Savitch::String Sav_String;
Sav_String.storeString("From namespace Savitch");
Teague::String Teag_String;
Teag_String.storeString("From namespace Teague");
}
```

Computer Science & Information Technology

You might also like to view...

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

1. The following function does not throw any unhandled exceptions void f1( ) throw ( ); 2. Functions that might throw an exception must have a throw list. 3. Functions may potentially throw at most one exception. 4. If a function throws an exception, it must be caught inside that function. 5. It is legal to have a catch block with no parameter.

Computer Science & Information Technology

The ____________________ form layout displays fields across the screen in rows, with a label above each field.

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

Computer Science & Information Technology