How to crete directories from string

Hello;

What I want to do, is to open/create a root and then create a new directory by passing its name with a reference of type string ie

[code]void CreateDir (string & dirname , TFile* fout);{

fout->mkdir(dirname);
fout->cd(dirname);

}
[/code]
Of course , if complains with returning message

no matching function for call to `TFile::mkdir(std::basic_string<char, std::char_traits, std::allocator >&)’
/swmgrs/cmss/slc4_ia32_gcc345/lcg/root/5.18.00a-cms21//include/TDirectoryFile.h:100: note: candidates are: virtual TDirectory* TDirectoryFile::mkdir(const char*, const char*)

Is there any way to do this?

Thanks in advance
Alex

see example in $ROOTSYS/tutorials/io/dirs.C

Rene

Hi,

Usefout->mkdir(dirname.c_str());

Philippe.

thanks–both replies worked!

A