It's simple. Do what Ash_ said and look up CreateFile().
http://msdn.microsoft.com/library/default.asp?url...ase/createfile.asp
I know it's long, but if you want to be a programmer you have to be capable of reading large amounts of text.
Notice that dwCreationDisposition says this:
code:
[in] Action to take on files that exist, and which action to take when files do not exist. For more information about this parameter, see the Remarks section. This parameter must be one of the following values.
CREATE_ALWAYS
Creates a new file. If the file exists, the function overwrites the file, clears the existing attributes, combines the specified file attributes and flags with FILE_ATTRIBUTE_ARCHIVE, but does not set the security descriptor specified by the SECURITY_ATTRIBUTES structure.
So that's all you need to do, use CreateFile(), then CloseHandle().
And since CreateFile is like this,
code:
HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile
);
going through each parameter on MSDN you'd end up with
HANDLE hFile=CreateFile("filename.txt", GENERIC_READ, NULL, NULL, CREATE_ALWAYS, NULL, NULL);
CloseHandle(hFile);
That's it. And if you can do linked lists, I'm sure you could have done this.