View Single Post
  #2 (permalink)  
Old 07-30-2006, 01:03 PM
icepack's Avatar   
icepack icepack is offline
Programmer
 
Join Date: Jul 2006
Location: North Carolina
Posts: 115
Credits: 0
Rep Power: 10
icepack is on a distinguished road
Send a message via AIM to icepack
Default

Not so much a function, but a way
Say you are trying to open a file to write to
you'd need to #include <fstream>

then to open the file use:
Code:
ofstream myFile("local location of file");
but you always have to check if that file actually exists, or else it's be useless. so
Code:
if (! myFile)
{
cout << "Error\n";
return -1;
}
is that what you wanted? i imagine you could just use that even if you didn't want to write to the file.
Reply With Quote