By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try :-

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

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Alfonso Morra" <sw***********@the-ring.com> wrote in message
news:db**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
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

Nov 17 '05 #2

P: n/a


Nishant Sivakumar wrote:
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")

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.