Is 'Cell' a microsoft keyword? (what's wrong with this code?)

A

Alfonso Morra

Hi,

I have the following code as part of a class:

class Cell {
public:
Cell( int ) ;
Cell( const Cell& ) ;
Cell& operator= Cell( const Cell& ) ; // <- compiler croaks here
virtual ~Cell() ;
...
};

The errors I'm getting are as ff:

error C2146: syntax error : missing ';' before identifier 'Cell'
error C2535: 'Cell::Cell(const Cell &)' : member function already
defined or declared

The copy constructor looks normal to me, and I really do not know what's
causing the problem - any help will be much appreciated
 
N

Nishant Sivakumar

Try :-

class Cell
{
public:
Cell( int );
Cell( const Cell& );
Cell& operator=( const Cell& );
virtual ~Cell();
//...
};
 
A

Alfonso Morra

Nishant said:
Try :-

class Cell
{
public:
Cell( int );
Cell( const Cell& );
Cell& operator=( const Cell& );
virtual ~Cell();
//...
};

Truly, truly dumb mistake on my part. Sometimes happens when you've been
staring at the screen for too long ;-( !

Many thanks Nishant, for pointing out my goofy mistake (caused by lazy
copy and pasting")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top