Help On Date.h Please

This is a discussion on Help On Date.h Please within the C++ Programming forums, part of the General Programming Boards category; hi everyone can someone tell me what is the problem of this code... Code: #include <iostream> #include <cstdlib> #include "date.h" ...

  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, 01:25 PM

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