Maria23's Profile User Rating: -----

Reputation: 2 Apprentice
Group:
Active Members
Active Posts:
77 (0.12 per day)
Joined:
24-November 12
Profile Views:
893
Last Active:
User is offline Nov 09 2013 07:51 AM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   Maria23 has not set their status

Posts I've Made

  1. In Topic: comparing dates

    Posted 31 Aug 2013

    ohhh..!! thats a mess i will have to change all my code if i do that, i mean i have a program that has 6 classes including the Date class, changing the Date class format from mine to yours will cuz a mess cuz i used the Date class millions of times base on my format ( int day int month int year..)

    thnx alot for ur help
  2. In Topic: comparing dates

    Posted 31 Aug 2013

    View Postjimblumberg, on 31 August 2013 - 04:30 PM, said:

    Well first you shouldn't be using the operator<= in your code. After all you're creating the operator<.

    So
        if(year < date.year && month < date.month && day < date.day)
    

    Should be all you need. No need for that OR section at all. You can also eliminate the if statement like:

    bool Date:: operator<(const Date& date)const
    {
       return(year < date.year && month < date.month && day < date.day);
    }
    


    Also stop with the SMS speak, you isn't u.


    Jim


    but what if its the same year or month or day?? like the examples i gave, the same year but different months and days, then it will return false cuz the year is not less than date.year its the same year !!
  3. In Topic: comparing dates

    Posted 31 Aug 2013

    View Postvividexstance, on 31 August 2013 - 04:15 PM, said:

    Write out that if-statement conditional using plain English and compare it to what Skydiver said in post #23:

    View PostSkydiver, on 31 August 2013 - 11:24 AM, said:

    If you write it out in words it should come to you...
    IF the year is smaller THEN it is less than;
    OR IF the month is smaller THEN it is less than;
    OR IF the date is smaller THEN it is less than.

    actully i dont understand what u both meant... what thats has to do with my code?
    im not an english speaker too thats why i have dificulties with understanding what u mean guys
  4. In Topic: comparing dates

    Posted 31 Aug 2013

    View Postvividexstance, on 31 August 2013 - 04:08 PM, said:

    Can you post the code please?


    which code u mean? the operator < ? i already posted it in a previous post
    bool Date:: operator<(const Date& date)const
    {
    	if( (year<=date.year && month<=date.month && day<=date.day)|| (year<=date.year && month<date.month) )
    		return true;
    	else
    		return false;
    }
    
    
    
  5. In Topic: comparing dates

    Posted 31 Aug 2013

    View PostSkydiver, on 31 August 2013 - 03:24 PM, said:

    If you write it out in words it should come to you...
    IF the year is smaller THEN it is less than;
    OR IF the month is smaller THEN it is less than;
    OR IF the date is smaller THEN it is less than.


    yes exactly... i tried my code i think it works fine... i did the operators < > to use the sort function of the STL list

My Information

Member Title:
D.I.C Head
Age:
20 years old
Birthday:
September 23, 1993
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

Comments

Maria23 has no profile comments yet. Why not say hello?