I am unable to create file in C:\ Drive using fopen() due to permission issue,is there any way by which I am able to create file in C drive. I am using Visual studio 2005. Here is the code:
int main()
{
std::string abc = "C:\\test.txt";
FILE* fp=NULL;
fp= fopen(abc.c_str(), "wt");
if(fp != NULL)
{
printf("Success");
fclose(fp);
}
else
printf("Fail");
getch();
return 0;
}