I am unable to create a directory using the following program :
#include <direct.h>
#include <iostream>
using namespace std;
int main() {
if(_mkdir("d:\ff") == 0) {
cout << "success";
} else {
cout << "fail";
}
}
This program outputs fail .why is it so ?
The compiler that i am using is microsoft visual c++ 2010 express
You need to escape your back slash.
See this http://msdn.microsoft.com/en-us/library/6aw8xdf2%28v=vs.80%29.aspx for list of escape sequences in C strings.