Re: Inheritance
On Jun 3, 5:05 pm, Jeff Schwab <j...@schwabcenter.com> wrote:
deepu wrote:
Please let me know how to concat two string using multiple
in heritance
The question is not clear. Concatenating strings is
ordinarily a run-time operation, whereas multiple inheritance
is ordinarily a compile-time operation. There is, by
definition, no way to perform a run-time operation at
compile-time, nor vice versa.
Yes and no. There are three ways to concatenate strings in C++,
depending on what you mean by "string". If the string
represents a token in the source code, you can use ## in a
macro---formally, this concatenates tokens, not strings, but in
most people's minds, there isn't much different. If he's
talking about concatenating string literals (the only real
compile-time "strings"), then just juxtaposing them is
sufficient. And of course, std::string overrides the + operator
to concatenate a runtime (and this is, of course, usually what
is meant by concatenation of strings).
The first two possibilities are compile time (but they still
have absolutely nothing to do with inheritance).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34