Possible Duplicate:
Why should the copy constructor accept its parameter by reference in C++?
I have the following code:
class Student {
private:
int no;
char name[14];
public:
void display() const;
Student(const Student& student); // Line 1
};
I have read that class is a reference type, so why in Line 1 of the above code declared as alias.
Is Line 1 equivalent to: Student(const Student student); ?
In C++, the assertion that “class is a reference type” makes no sense. You may have heard this in connection with C# but this is a completely different matter.
Consequently, the whole discussion is moot. To understand the syntax of copy constructors you first need to understand references (those do exist in C++) and classes in general. Grab a good C++ book for beginners.