If you want to write cross-platform code, you can use boost::filesystem
routines
#include <boost/filesystem.hpp>
boost::filesystem::create_directory("dirname");
This does add a library dependency but chances are you are going to use other filesystem routines as well and boost::filesystem
has some great interfaces for that.
If you only need to make a new directory and if you are only going to use VS 2008, you can use _mkdir()
as others have noted.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…