Noob question: How do this work?

Refering to article: You want to build a program but where to start?//
http://www.cplusplus.com/forum/articles/11/

1
2
3
4
5
6
7
8
9
10
11
12
class StudentEntry
{
public:
	StudentEntry(NAME name, MARK mark): name(name), mark(mark){}
	void operator = (StudentEntry *entry)
	{
		name = entry->name;
		mark = entry->mark;
	}
	NAME name;
	MARK mark;
}*entryList[MAX_STUDENT]; 


}*entryList[MAX_STUDENT]; <-- what is this, and how do it work? can someone give me a few more examples of how to use this?

I ask because I am trying to create a header file that do all the fstream stuff for me--looking for a way to take in an entire file/list, and pass it to a class. I tried to use vector but that didn't work too well, so I found this examples here. But I have problem manuplating it. Some help/hint/explaination/guidance/examples would help me out a lot. Thank You. ^_^

Basically, you're, in the same statement, declaring a class and a global array of MAX_STUDENT (which is a #defined constant) pointers to the declared class.
Last edited on
It is a 'shorthand' way of declaring varaibles.

It is equivelent to
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class StudentEntry
{
public:
	StudentEntry(NAME name, MARK mark): name(name), mark(mark){}
	void operator = (StudentEntry *entry)
	{
		name = entry->name;
		mark = entry->mark;
	}
	NAME name;
	MARK mark;
};

StudentEntry* entryList[MAX_STUDENT]; 
Arrgs...I hate pointer. So confusing. Thx guys.
Topic archived. No new replies allowed.