Need help with Bool

This is a discussion on Need help with Bool within the C++ Programming forums, part of the General Programming Boards category; I am a beginner at C++ and one of the things I am trying to do is Compile this: class ...

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    Need help with Bool

    I am a beginner at C++ and one of the things I am trying to do is Compile this:

    class ClockType
    {
    public:
    void setTime(int, int, int);
    void getTime(int&, int&, int&);
    void printTime() const;
    void incrementSeconds();
    void incrementMinutes();
    void incrementHours();
    bool equalTime(const clockType& otherClock) const;
    private:
    int hr;
    int min;
    int sec;
    };

    However, Visual C++ and Dev-C++ are saying "Syntax error before '&' token." for line 10. I really don't understand that much yet, but I can't figure what I am suppose to do with that line.

    JCuervo811

  2. #2
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,088
    Code:
     bool equalTime(const clockType& otherClock) const;
    should be
    Code:
     bool equalTime(const ClockType& otherClock) const;
    Case matters in C++.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. passing params between managed c++ and unmanaged c++
    By cechen in forum C++ Programming
    Replies: 11
    Last Post: 02-03-2009, 08:46 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 08:05 AM
  3. DirectInput help
    By Muphin in forum Game Programming
    Replies: 2
    Last Post: 09-10-2005, 12:52 PM
  4. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 05:25 AM
  5. Need Help With an RPG Style Game
    By JayDog in forum Game Programming
    Replies: 6
    Last Post: 03-30-2003, 08:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21