"Curtis L. Olson" <[EMAIL PROTECTED]> writes:

> Originally this was changed to something like:
>
>    cout << "usage:
>
> Nicely formatted text
>    that will look
>  exactly like it is entered
> here when
>
>    it is displayed by the program.
> This is very 'pretty' to be able 
>          to do." << endl;
>
> However, MSVC doesn't accept this so we are forced to at \n\ to the
> end of every line which starts to increase the ugliness factor
> again. <sigh>

This can be done portably using the standard "string concatenation" feature of
the language.  The above would look like the following and likely work with
any reasonably modern compiler (this string concatenation feature did not
exist in K&R C but did beginning with early versions of ANSI C):

   cout << "usage:\n"
           "\n"
           "Nicely formatted text\n"
           "   that will look\n"
           " (almost) exactly like it is entered\n"
           "here when\n"
           "\n"
           "   it is displayed by the program.\n"
           "This is very 'pretty' to be able\n"
           "         to do.\n";

or (substantially less readable, IMHO, but more C++ like)...

   cout << "usage:" << endl <<
           endl <<
           "Nicely formatted text" << endl <<
           "   that will look" << endl <<
           " (kind of close to) like it is entered" << endl <<
           "here when" << endl <<
           endl <<
           "   it is displayed by the program." << endl <<
           "This is very 'pretty' to be able" << endl <<
           "         to do." << endl;

Derrell

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to