Thread: confusing error.... plz help

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    5

    confusing error.... plz help

    Hey everybody,

    I am getting a weird error that i cant understand how to get working again. I have made a custom vector class for myself that works perfectly in every program so far; but when i try and compile ANY program that uses Vector with Visual Studio, and visual studio ONLY... it comes out with this error:

    error C2063: '=' : not a function ......... as well as
    error C2040: '=' : 'class Vector<TYPE> &(const class Vector<TYPE> &)' differs in levels of indirection from 'int' ... also
    fatal error C1903: unable to recover from previous error(s); stopping compilation

    And that only happen in VS and the program compiles and executes fine in any other compiler.. it just screws up in VS.
    Could someone please help me and tell me whats going on and what i could do to fix it?

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    a code snippet would be helpful!
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    5
    THe "offending" line that are causing the errors... it only does this in the VS compiler though...

    Vector<TYPE> & Vector<TYPE>:perator =(const Vector<TYPE> & rhs);

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    Vector<TYPE> & Vector<TYPE>::operator =(const Vector<TYPE> & rhs);

    is a prototype... not a function body... if that's outside your class then you need to declare a function body.. if it's inside, you dont need to specify the scope.

    if this doesn't help.. zip up the source file, and examples of where this is used in the code (not just the definition of the function) and post again... i dont have enough info to help you (others might, but i need more ;)).

    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Most confusing language
    By Suchy in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 04-22-2007, 09:08 PM
  2. Arrays are confusing...
    By GavinHawk in forum C Programming
    Replies: 10
    Last Post: 11-29-2005, 01:09 AM
  3. Confusing Pointer
    By loko in forum C Programming
    Replies: 4
    Last Post: 08-29-2005, 08:52 PM
  4. pointers are confusing!
    By ali1 in forum C Programming
    Replies: 10
    Last Post: 09-07-2004, 10:41 PM
  5. functions declaration, pointers, cast, .... CONFUSING
    By Rhodium in forum C Programming
    Replies: 7
    Last Post: 01-09-2003, 06:21 AM