What is the error here?

This is a discussion on What is the error here? within the C++ Programming forums, part of the General Programming Boards category; #include<iostream> using namespace std; #include "Time.h" int main(void) { TimeOfDay time1, time2; int hours = 19, minutes = 15; time1.setTime(7, ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    What is the error here?

    #include<iostream>


    using namespace std;

    #include "Time.h"

    int main(void)
    {
    TimeOfDay time1, time2;
    int hours = 19, minutes = 15;
    time1.setTime(7, 35);
    time2.setTime(hours, minutes);
    cout<<"First time: ";
    time1.displayMilitaryTime();
    cout<<endl<<"First Time: ";

    time1.displayTime();
    cout<<endl<<"Second time: ";

    time2.displayMilitaryTime();
    cout<<endl<<"Second time: ";
    time2.displayTime();
    return 0;
    }

    C:\Documents and Settings\Administrator.COMPUTER-1ZZXR1\Desktop\Web Folders\C++\Time.cpp(29) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Display the code for time.h. BTW, your compiler might not like the title of your header because there already is a time.h.

Popular pages Recent additions subscribe to a feed

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