help with one minor error
ok...this is really simple (even though i can't get it). My program only has one error which i can't seem to get out. Here is my code:
Code:
#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
class person
{
public:
person()
{
fName = "\0";
lName = "\0";
number = 0;
~person()
{
}
private:
char fName[40];
char lName[40];
int number;
};
int main()
{
for(;;)
{
int choice = 0;
person p;
cout << "Enter the person's first name: ";
cin >> p.fName;
cout "\nEnter the person's last name: ";
cin >> p.lName;
cout << "\nEnter the person's telephone number: ";
cin >> p.number;
file("data.txt", ios::ate);
file << "\nID = ";
file << i;
file << "\nName: ";
file << fName;
file << " ";
file << lName;
file << "\nTelephone Number: ";
file << number;
file << "-----------------------------------\n\n";
cout << "Data stored in data.txt...\n";
cout << "Enter another?(y or n) ";
cin >> choice;
if(choice == 'n')
{
break;
}
}
return 0;
}
and i keep getting this error:
Code:
fatal error C1004: unexpected end of file found
This error is pointing to just under the last close brace. I have tried everything like adding a brace/adding several braces and i have tried to take it away, but that doesn't work. BTW, i am using MSVC++ 6.0
Thanks
-Chris