Link to home
Start Free TrialLog in
Avatar of Parth48
Parth48Flag for India

asked on

how to make directory in C++ ??

how to make directory and then create text file in C++ ?

Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

>> then create text file in C++ ?
http://www.cplusplus.com/reference/iostream/ofstream/
std::ofstream out("test_file.txt");
out << "test";

Open in new window

Avatar of Parth48

ASKER

can u please create one directory in C Drive using C++ program ?

please tell me via example ...
Sure
if(0 == mkdir("c:\\temp", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
{
   // worked
}
else
{
   // failed
}

Open in new window

Avatar of Parth48

ASKER

i am Compile C++ program in Visual studio 2008 using win32 console application ..

now how can i create directory in C++ ?

because it give me error for mkdir function doesn't exist ..

what can i do ?
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Parth48

ASKER

@evilrix : Thanks very much ...
You are most welcome. Post back here if you have any more concerns about this :)