Re: [ROOT] how to correctly stream chat* data ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 29 2001 - 09:12:34 MET


Hi Joe,

The development version in CVS supports char* directly. With this version,
you can specify:
  char*  fTitle;
This member will be correctly streamed in/out. You do not need to give
the length in the comment field as a char* must be terminated by a null
character.

If you cannot use the development version, use a TString instead.

Rene Brun

joe robe wrote:
> 
> Hi Rooters,
> 
> in my class I use a char* datatype.
> 
> In the h file I have:
> 
> Int_t fSizeTitle;
> char* fTitle;//[fSizeTitle]
> 
> and the inline function
> 
> void SetTitle(char*
> Title){fTitle=Title;fSizeTitle=strlen(Title);};
> 
> However when I write the object to the disk and reload
> it, char* is LONGER than before and filled with some
> zzzz and the end.
> 
> What am I doing wrong here ?
> 
> Joe
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:10 MET