When I execute the program, the file is saved in: C:\Users\Name\AppData\Local\VirtualStore\Windows instead. The program's working directory is C:\cplusplus\filewriter
I am working on a 64 bit vista OS. I am compiling with MSVC++
You seem to be using Windows Vista, or maybe Windows 7. You are experiencing file system virtualization. If you want to avoid it and get the file inside C:\Windows, you must run your application with elevated privileges.
Apparently Vista for some reason does not run applications as an administrator by default, even when the user is logged in as an administrator. Thanks for the hint.
I beg to differ. Windows Vista is excellent in my opinion, and Windows 7 by extension. Windows 7 administers RAM better, and maybe other system resources.
The problem is the programmers (sorry to say) like you. Windows Vista requires elevation to protect the operating system from harm. There are PLENTY of ways to share data among users if that is your goal, primarily the Public folders.
Just because you don't know how the operating system works doesn't mean that it is crap. Get a good book about Windows Programming and you'll change your sentiment about this wonderful operating system.
I suppose I should clarify my dissatisfaction with Windows. I am fully aware that I lack any programming experience/know how to criticize anything for it not being/being a good/bad environment for programming. My complaint regarding Vista is its resource intensity and several bugs that occur from time to time that annoy me, not its impact on anyone's ability to write software.
Perhaps to say ''how not to write an OS" is over the top, for that I apologize.
LOL! Maybe I also need to apologize. I know that my reply sounded harsh towards you. It was never personal. I just used a facet of you (the programmer facet) as an example of what people in general out there do.
So I just wanted to assure you that it wasn't personal. I like Windows, and I sure defend it, but I didn't create it, and I certainly don't earn a dime on its sales, therefore you insulting Windows is never an insult to me. I just "illuminate" people whenever I hear misconceptions about the OS.
No sweat. I'm pretty difficult to offend, and surely wouldn't be over a discussion on programming.
I know very little about the subject, and have much to learn. Windows is the commercial standard OS for a reason.
Although I am legitimately interested in what all the buzz is about linux seemingly being geared towards programmers - as I read this almost every time I research anything related to programming.
If you PC has the power, I would recommend getting somthing like VirtualBox[1] and installing Linux in it. You will be able to investigate it with no real impact on your system.
I don't dislike Microsoft but I am getting disenchanted with them. Vista has never impressed me, at least not enough to make me want to move away from XP.
Not sure how much you know about different linux distributions, but in my humble opinion, starting out with Ubuntu ( www.ubuntu.com/ ) is probably a good idea, then when/if you feel like you're being held back you can upgrade to something like Fedora ( fedoraproject.org/ ).
Like Grey Wolf said, check out virtualbox, try a few different distro's and see how you go