Help

This is a discussion on Help within the C++ Programming forums, part of the General Programming Boards category; I want to create a class of date,,in which there is a member function checker which checks the month no. ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    112

    Help

    I want to create a class of date,,in which there is a member function checker which checks the month no. if the month is 1 then its has max 31 days,, for 2 month leap year etc,, i know what i want to do but i dun know how to implement this,, kindly help me using switch case,,!!

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,712
    It may be easier to create an array of the number of days in each month of the year, and just check based on that. You could handle February separately to account for leap years.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

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