Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alfonso Morra - 18 Jul 2005 09:52 GMT
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
Nishant Sivakumar - 18 Jul 2005 10:04 GMT
Try :-

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

Signature

Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com

> Hi,
>
[quoted text clipped - 17 lines]
> The copy constructor looks normal to me, and I really do not know what's
> causing the problem - any help will be much appreciated
Alfonso Morra - 18 Jul 2005 10:25 GMT
> Try :-
>
[quoted text clipped - 7 lines]
>  //...
> };

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")

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.