Acidburn 0 Posting Pro

hello, another stupid question but what is wrong with this?

infile.open("new.txt",ios::app);
	if (infile.fail())
		{
		cerr << "Error";
	             exit(1);
		}

ever since I've added the ios::app it keeps printing error and then haulting but from my resoruces if you want to append a txt file thats whats the syntax is......can anyone offer a hand?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.