[EMAIL PROTECTED] wrote: > > 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;
Note: You 2nd version does *not* use the string concatenation. The 2nd version boils down to the very C++ dependant operator<<(operator<<(operator<<(cout, "usage"),endl),...); (I might have the scoping wrong, but that's not changing the idea behind it) CU, Christian -- The idea is to die young as late as possible. -- Ashley Montague Whoever that is/was; (c) by Douglas Adams would have been better... _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel