Thread: Help On Date.h Please

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    71

    Help On Date.h Please

    hi everyone can someone tell me what is the problem of this code...
    Code:
    #include <iostream>
    #include <cstdlib>
    #include "date.h"
    using namespace std;
    int NextSatVal(Date& today);
    int main()
    {
        int d, m, y;
        
        cout<<"Enter: ";
        cin>>d>>m>>y;
               
        Date today(m, d, y);                  
        
        NextSatVal(Date& today); 
         
        system("pause");
        return 0;
    }    
    
    int NextSatVal(Date& today)
    {
        while(today.Month() != 2 && today.Day() != 14 && today.DayName() != "Saturday")
        {
            today++;
        }
        return today.year();
    }
    my aim of this code is to find the next valentine in saturday.
    thank you

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    71
    i ran this program and change it but end up with this line of error
    [code[

    NextSatVal(Date& today);

    [/code]

  3. #3
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    When you call the function, don't include the type:
    NextSatVal(today); is sufficient.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inheritance, istream, class datamember
    By guda in forum C++ Programming
    Replies: 4
    Last Post: 09-30-2004, 12:25 PM