I have two questions about writing to a text file. I've made and revised a program (thanks too some people on an earlier post), but I was wondering how a code to check to see if somethign were to exist would look like(and read what it has if it's true then compare it to something else).
Also, I'm making a program for our church. The user types in their information, then it saves it to a text file. The next upgrade from that is to email it, (if you know how please post a code). I've tried using streamwriter and
you would to check if a file exists? this is what i would do
1 2 3 4 5 6 7 8 9
ifstreamObject.open("someFile.txt");
if(ifstreamObject.fail())
{
//code corresponding to the nonexistence of the file
}
else
{
//code corresponding to the existence of the file
}