T
Tom Johnson
Hi all, I cant believe that Im stuck on such simple code, but I am
so...
Im trying to open a text file for writing but can never get the file
to initially open. Heres what Im having trouble with.
-----------------------------------------------
#include <iostream.h>
#include <fstream.h>
void main()
{
ofstream file ("C:\inventory\example.txt")
if (!file.is_open)cout<<"not open";
}
------------------------------------------------
Ive tried ios:ut, ios::app, etc... but I just keep getting "not
open" in the console. Its been 3 years since I learned and used
Visual C++ and I just picked it up again yesterday, so am I forgetting
something? Any help would be greatly appreciated. Thanks!
Tom Johnson
so...
Im trying to open a text file for writing but can never get the file
to initially open. Heres what Im having trouble with.
-----------------------------------------------
#include <iostream.h>
#include <fstream.h>
void main()
{
ofstream file ("C:\inventory\example.txt")
if (!file.is_open)cout<<"not open";
}
------------------------------------------------
Ive tried ios:ut, ios::app, etc... but I just keep getting "not
open" in the console. Its been 3 years since I learned and used
Visual C++ and I just picked it up again yesterday, so am I forgetting
something? Any help would be greatly appreciated. Thanks!
Tom Johnson