> Vallabha wrote:
> > On May 14, 12:31 pm, "michael" <s
@begone.net> wrote:
> >> I have the following:
> >> class ClassA {
> >> };
> >> class ClassB {
> >> };
> >> int main(){
> >> ClassA a;
> >> ClassB b;
> >> cout << typeid(a).name() << endl;
> >> cout << typeid(b).name() << endl;
> >> }
> >> when this executes it prints:
> >> 6ClassA
> >> 6ClassB
> >> Where does the '6' come from?
> >> Thanks for your help
> > I compiled your code on my Solaris box and it gave me correct results.
> > ./a.out
> > classA
> > classB
> The results are correct on both machines. The return of typeid is
> implementation specific. There's no guarantee that it's meaningful
> to humans at all. It's certainly NOT unique (nor required to be) for
> distinct types.
In fact, an empty string for every type would also be Some implementations choose to do something useful. Others not.