What is a complete class in C++?

Doing review for my midterm and don't really understand what do i need here, I'm assuming constructor destructor.. What functions or operators does this
class contain?


Another question i have is:

What are the differences in the function calls between the four member
functions of the Shape class below.

void Shape :: member ( Shape s1, Shape s2 ) ;
void Shape :: member ( Shape *s1, Shape *s2 ) ;
void Shape :: member ( Shape& s1, Shape& s2 ) const ;
void Shape :: member ( const Shape& s1, const Shape& s2 ) ;
void Shape :: member ( const Shape& s1, const Shape& s2 ) const ;
What is a complete class in C++?
There's nothing like an incomplete class. In other words: you can leave it completely empty and it's ok.

What I think you're refering to is a forward declaration of a class:

http://en.wikipedia.org/wiki/Forward_declaration

The you cannot access members of this class because the compiler doesn't know them and so shows the complaint 'incomplete class'


1
2
3
4
5
void Shape :: member ( Shape s1, Shape s2 ) ; // pass by value
void Shape :: member ( Shape *s1, Shape *s2 ) ; // pass by pointer
void Shape :: member ( Shape& s1, Shape& s2 ) const ; // pass by reference
void Shape :: member ( const Shape& s1, const Shape& s2 ) ; // pass by const reference
void Shape :: member ( const Shape& s1, const Shape& s2 ) const ; // plus the function is const 


See:
http://www.cplusplus.com/doc/tutorial/functions2/
Thank you !!!
Topic archived. No new replies allowed.