Re: typical problem in C... hot to solve



On Dec 12, 7:56 am, Jack Klein <jackkl...@xxxxxxxxxxx> wrote:
On Thu, 11 Dec 2008 02:06:49 -0800 (PST), "@$|-|. DUBEY"
<dubey.ashw...@xxxxxxxxx> wrote in comp.lang.c:



On Dec 11, 2:50 pm, nick_keighley_nos...@xxxxxxxxxxx wrote:
On 11 Dec, 09:08, "@$|-|. DUBEY" <dubey.ashw...@xxxxxxxxx> wrote:

hello every one.
i have this problem in c.

i have to check that the input date doesnot exceed the tomorrow date.
eg. if input date = 12-10-2004
then it should be always less than 12-12-2008
because today is 11-12-2008.

and input date should be valid one.
like jan is 30 days.
dec is 31 days.
feb is 28 ( if not leap year)....

how to solve this problem

how far have you got?
If I were you you I'd take a look at the stuff in time.h.
There's a reference herehttp://www.dinkumware.com/manuals/?manual=compleat&page=time.html

Start by writing a program to print today's date.

--
Nick Keighley

do you have some typical algorithm..
for this problem
i have current date.....
and user input date....

what's next....

Here's what's next, tell your employer to hire a qualified C
programmer.  I've been doing embedded systems in C for more than 25
years, what will they pay someone who already knows how to do your
job?

--
Jack Klein
Home:http://JK-Technology.Com
FAQs for
comp.lang.chttp://c-faq.com/
comp.lang.c++http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html

wow,
so rude,
some day i will have 25 years of experience and i wouldn't say these
words to any newbee.
man you think, you are trying to steal a lollypop from kid,
watch out.....


well see how i solved the problem
i have current date... ddmmyyy ( 12/12/2008 )
i have user date....ddmmyyy ( 14/03/1983 )
i reversed the both date to yyyddmm
so i get....

m_crnt_date = 20081212;
m_my_dob = 19831402;

since both are converted to integer formate
it can be compared....
if( m_my_dob >= m_crnt_date )

that's done...

can you comment on this......
.



Relevant Pages

  • Re: Were spoiled
    ... help for what stores like that pay. ... rude towards that man made me so angry. ... I got to thinking about how great the pipe and tobacco retailers are, ...
    (alt.smokers.pipes)
  • Re: Guitar Center Online Horror Story
    ... service jobs...it KILLS me when I get rude or poor service at a fast ... who do complain are considered to be the rude ones. ... in the eyes, demand their attention, and say, "Would it kill you to ... I don't really agree with that system entirely, where the basic pay is ...
    (alt.guitar.bass)
  • Re: Guitar Center Online Horror Story
    ... service jobs...it KILLS me when I get rude or poor service at a fast ... who do complain are considered to be the rude ones. ... I get bad service and I still leave 15% for the waiter? ... I don't really agree with that system entirely, where the basic pay is ...
    (alt.guitar.bass)
  • Re: Does Sexual Behavior Affect Our Afterlife (Question for Bahais)?
    ... you rude little sexist - do you EVER pay even the ... SLIGHTEST attention to anything anyone else says around here? ... Darrick wrote: ... btw - it's rude to tell someone what they believe, ...
    (talk.religion.bahai)
  • Re: When to use automatic variables and when to use malloc
    ... It's the price you pay for being rude. ... whinging twit with no brains is brusque and crusty, then I killfile ...
    (comp.lang.c)