i wrote some code to createfile in c++ it compiles without errors, but it doesn't create any file.. Can anyone tell me what is wrong ? thanks
#include <iostream>
#include <windows.h>
#include <string>
using namespace std;
int main()
{
HANDLE hfile;
char data[] = "some text to write into file";
hfile = CreateFile(
L"c:\name.txt",
GENERIC_WRITE,
0,
NULL,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
/*
if (hFile == INVALID_HANDLE_VALUE)
{
cout << "Unable to create file \n";
}
*/
return 0;
}