Thread: = Operator Error in Class

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    51

    = Operator Error in Class

    I tried to use the = in one of my functions within my class. Oddly enough, it says thats theres an error assigning.

    Code:
    clase Name
    {
    public:
     void setNumber(short iNumber)
     {
      itiNumber = iNumber;
     }
    private:
     int itiNumber;
    }
    Please help!

    Thanks in advance.

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >>short iNumber
    >>int itiNumber

    Try int iNumber.

    What error are you getting?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Your missing a ; at the end of the class.

    Code:
    class Foo
    {
    
    }; // <----

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    51

    Thanks!

    I found my error. I used the wrong type in my class. Thanks for all the suggestions!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  3. Defining derivated class problem
    By mikahell in forum C++ Programming
    Replies: 9
    Last Post: 08-22-2007, 02:46 PM
  4. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM