Newbie HELP

This is a discussion on Newbie HELP within the C++ Programming forums, part of the General Programming Boards category; heres my code................ // time.h #include <iostream> using std::cout; using std::cin; using std::endl; class Time { public: void setTime(); void ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    20

    Newbie HELP

    heres my code................

    // time.h

    #include <iostream>

    using std::cout;
    using std::cin;
    using std::endl;


    class Time
    {
    public:
    void setTime();
    void print();

    private:
    int hour;
    int minute;
    int second;

    };
    void Time::setTime()
    {
    cout << endl;
    cout << "Please enter the time (HH:MM:SS) ====> ";
    }
    void Time:rint()
    {
    endl;
    cout << hour << minute << second;
    }

    // Time.cpp

    #include <iostream>
    #include "time.h"

    using std::cout;
    using std::cin;
    using std::endl;


    int main()
    {
    Time tim;

    tim.setTime();
    tim.print();

    return 0;
    }

    When i compile using Visual c++ i get this error message....

    time.h(28) warning C4551: function call missing argument list
    time.h(28) : error C2568: 'identifier' : unable to resolve function overload

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421

    Talking

    this is wrong:

    Code:
    void Time::Print() 
    { 
       endl; 
       cout << hour << minute << second; 
    }
    it should be:

    Code:
    void Time::Print() 
    { 
       cout << endl << hour << minute << second; 
    }
    hope this helps
    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. getting to grips with allegro and ms vc++ (newbie)
    By jimjamjahaa in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2005, 06:49 PM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 11:53 AM
  3. Newbie Programmer
    By Extropian in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 01:17 PM
  4. Some help for a newbie?
    By Ilmater in forum C++ Programming
    Replies: 23
    Last Post: 04-19-2004, 07:44 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM

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