14 is old enough - I started programming around the 4th grade, as did many of my friends.
If the code compiles and runs, but produces no file, I would try changing the fileName to an absolute filepath, something like "C:\TEMP\example.txt" (you may need \\ or double slashes here, twice - I don't know how C's backslash convention interferes with Window's \ convention for directories).
See if that works.
If you are getting compile or link errors, post the details.
@ kfmfe04 & OP: Both C\C++ and Windows use UNC so a single backslash '\' is an escape character by default; any literal strings need to be double backslashed. Other then that I would use the 'fstream' header in place of 'System.IO' but that's more of a style preference.
Thanks, by the way. I'm at school now and I can't work on it, but I will as soon as I get home, and I'll tell you if it works. I know about escape characters. If I'm using Visual C++, it uses .NET, but how is it different? I've used C++ coding in there.
Visual Studio doesn't force you to use .NET. You can write (normal!) C++ programs with it too.
C++/CLI is a language designed to use .NET while still looking a bit like C++. However, it is a different language. It has new concepts such as "handles".
I know how to do ofstream and all, but you showed me a simpler looking way to do it so thanks, but it didn't work in my program (probably cause you said it's a different language). I've put too much work into it, to start over. Can you show me a code (if you know how) in C++/CLI for a text writer?
Are you saying that you are using .NET in C++? Or that you are trying to make the program without .NET? I am not sure there is a designer for not .NET programming.
I'd rather make it so it doesn't have .NET, but there's no designer for it (unless you pay a lot). But the Windows Forms Applications uses C++\CLI. Which by what I understand is a .NET language which is made to look like C++.