Implementing The Servant (Cont.) // print out a prmopt, and read a message from the user. stores // the message in 'message', and returns the length of the // message. reads num_bytes from standard input and returns it. CORBA::Long HelloWorldImpl::readMessage(const char* prompt, CORBA::String_out message) { // print out a prompt. cout << (prompt ? prompt : "Input:") << flush; // read input from STDIN. char buf[1024]; cin >> buf; // buf's contents is copied into 'message'. message = CORBA::string_dup(buf); cout << "Returning '" << message.ptr() << "'" << endl << flush; return strlen(buf); }