|
NO difference.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hi all,
Please tell me how can find the Feburary is Leap Year or not.
How can Check the number of days of Feburary,it is 28 or 29.
please help me for this.
I m waiting for your Valuable suggestions.
Thanks in Advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Well it is simple:
bool isLeapYear(int year )
{
return year % 400 ? year % 100 ? year % 4 ? false : true : false : true;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
That's superb!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thank you, pal.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Jijo raj wrote: That's superb!
that's school classics...
I didn't bother posting it, as it's obvious you can find tons of functions doing this with google
|
|
|
|
|
Actually I extemporized.
(My school had nothing to do with C++ ).
BTW I think he was referring to handcrafted code obfuscation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
WTF is going on here ?
since few days, everything I say is voted 1 !
BTW, whatever your school was doing (yeah, most school weren't teaching C/C++ in the 80's), but that's a classic anyway, and you find tons of it in google however !!!
|
|
|
|
|
Three 1 s, you have a lot of enemies! Got my five for a bit balancing.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
thanks for the "load balancing", but anyway, I still don't understand why those votes...
I believe so people find my answers arrogant too much, or are targetting my MVP status (I'm aware that I'm not the only MVP in that case), but whatever the reasons, I maintain that it was a question google had answered i less than 5 minutes...
|
|
|
|
|
toxcct wrote: I believe so people find my answers arrogant too much,
I guess the above is the reason. Anyway that doesn't justify them: I don't like down-voting-without-reply, i.e. if someone votes you down then (IMHO) he (or she) has the moral duty to make you know why.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Are you an adept of code obfuscation ?
|
|
|
|
|
Yes, a kind of: I was aware of it and I could not resist the temptation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
No wonder: I'm a man.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You can use COleDateTime::SetDate() . Check the return value to check whether the date is wrong. For instance, in your leap year checking case,
COleDateTime DateTime;
if( 0 == DateTime.SetDate( 2007, 2, 29 ))
{
}
if( 0 == DateTime.SetDate( 2008, 2, 29 ))
{
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Something wrong in it?
Might not be the best, but its just a different method. Please correct me if I'm wrong.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Got my five to balance a bit.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks buddy! Now I'll tell one secret. Just few hrs back I've also done the same for your - http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2588613[^]
BTW, I think we need one optional field to tell the reason, "whats wrong in it" while marking negative. I'm always open to critic, since mistakes are just human. But here how can we correct and improve ourself without knowing the reason? Pallini, what's your opinion?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Jijo raj wrote: Thanks buddy! [Big Grin] Now I'll tell one secret. Just few hrs back I've also done the same for your - http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2588613[^]
Thanks.
Jijo raj wrote: BTW, I think we need one optional field to tell the reason, "whats wrong in it" while marking negative. I'm always open to critic, since mistakes are just human. But here how can we correct and improve ourself without knowing the reason? Pallini, what's your opinion?
IMHO people voting down has the moral duty to motivate it (and you have pointerd out why). I often ranted about down-voting-without-reply (got no results, of course).
I think, no matter what we can do, the battle against trolls is a lost one, my friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: I think, no matter what we can do, the battle against trolls is a lost one, my friend.
[Frown]
Very true.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
5 for inventiveness, 1 because I'd never want one of my programmers to use it!
Graham
Librarians rule, Ook!
|
|
|
|
|
ThatsMe. wrote: Feburary is Leap year or not
Because February can never be a leap year, not even a year for that matter.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
i have set my default page as www.google.com whenever. i wanted to know where the history for search gets stored.
how can i delete this history programatically.
|
|
|
|