What is wrong with this code? The error message runs every time, and the file is never opened. It worked ok when it was ofstream instead of just fstream. I can't figure out what's wrong. Thanks!
Code:
#include "person.h"
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
	fstream personOut("nameAge.txt", ios::in | ios::out);
	if (!personOut) {cout << "Error!";}