fatal error C1020

hey every body

i have this problem while i compile my program

fatal error C1020: unexpected #endif


the error occur in the header file :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//assignment 4 
//Done By: NAwaf Abdullah Humaid Al-shibli
//ID: 81303
#include <iostream>
#include <string>

using namespace std;
class PhoneRecord
{
public:	
	PhoneRecord();

	PhoneRecord(string n); 

	PhoneRecord(string n, string pn); 

	friend bool operator< (PhoneRecord, PhoneRecord);

	friend bool operator> (PhoneRecord, PhoneRecord);

	friend bool operator==(PhoneRecord, PhoneRecord);

	PhoneRecord operator=(PhoneRecord);

	string fname;

	string lname;

	string phone;
};
#endif \\fatal error C1020: unexpected #endif!!



how to fix it?
1_ Remove the #endif
A_ Add an #ifndef some_unique_name_that_indentifies_the_header
\alpha_ Add #pragma once at the beginning and remove the #endif

(those are three independent choices. Pick one and understand it)
Last edited on
http://en.wikipedia.org/wiki/Include_guard for more info on why that #endif is there
Topic archived. No new replies allowed.