Re:

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Sep 08 1998 - 15:56:31 MEST


Constantinos Loizides wrote:
> 
> Dear Rooters,
> 
> whats wrong with the following statements:
> 
> char * s="Hallo";
> TString *text=new TString(s);
> printf("%s --- %s\n",s,(char *)text);
> 
> the output to that looks like:
> Hallo --- @O¼z×ì`«
> 
> 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



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:37 MET