CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jun 2002
    Posts
    1,417

    No Copy Constructor Available Error

    What is calusing the error shown in [COLOR=red]RED[/red] below? How to fix it?

    [code]
    class CCellID
    {
    public:
    CCellID() {row = col= 0;}
    CCellID(long r,long c) {row = r;col = c;}
    CCellID(CCellID& id) {Copy(id);}
    void Copy(CCellID& id) {row = id.row; col = id.col;}
    void operator=(CCellID& id) {row = id.row; col = id.col;}
    int operator==(CCellID& id) {return (row == id.row && col == id.col) ? TRUE : FALSE;}
    protected:
    long row,col;
    };


    class A
    {
    public:
    CCellID GetCell() {return m_cell;}
    [COLOR=red]error C2652: 'CCellID' : illegal copy constructor: first parameter must not be a 'CCellID'[/red]
    protected:
    CCellID m_cell;
    }
    Last edited by stober; April 26th, 2003 at 05:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured