(no subject)

Rene Brun (Rene.Brun@cern.ch)
Tue, 08 Sep 1998 15:56:31 +0200


Constantinos Loizides wrote:
> =

> Dear Rooters,
> =

> whats wrong with the following statements:
> =

> char * s=3D"Hallo";
> TString *text=3Dnew TString(s);
> printf("%s --- %s\n",s,(char *)text);
> =

> the output to that looks like:
> Hallo --- @O=BCz=D7=EC`=AB
> =

> What am I doing wrong?

printf does not accept casting of a TString to a char*.
instead do:
printf("%s --- %s\n",s,text.Data());

Rene Brun