🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.programming
Article #6

Re: need help - formatting input

#6
From: Psybar Phreak
Date: Mon, 20 Jan 2003 12:52
39 lines
2204 bytes
sorry - prolly should have emtnioned i was trying to do this in c

thanks

daina


"Psybar Phreak" <gotyoubacktoo@yahoo.com> wrote in message
news:3e2bbf5d$0$7813$afc38c87@news.optusnet.com.au...
> hi all....  hope someone can lend me a  little help on a problem im
working
> on
>
> background desc :  program can take either
> 1)  Two dates in the format (yyyymmdd) through stdin, or
> 2) One date in the format (yyyymmdd) and a single number (up to 7 digits
> long)
>
> firstly i was thinking about using scanf("%03d, %01d, %01d", &year,
&month,
> &day);  but that will only work in case 1 where there's two dates
>
> sooo....  does anyone know a way, in which i could just save the 2 inputs
as
> separate int's, run a check on the length of it, then, if its a date,
break
> it into pieces so i get the year in one variable, the month in another,
and
> the day in another?!??!
>
> what do you think?  would this be the easiest way about it or am imissing
> something a lot easier?
>
> thanks everyone
>
> daina
> sydney, australia
>
>
Technical Details
Message-ID: <3e2bf105$0$7815$afc38c87@news.optusnet.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!news1.optus.net.au!optus!spool01.syd.optusnet.com.au!spool.optusnet.com.au!not-for-mail
References: <3e2bbf5d$0$7813$afc38c87@news.optusnet.com.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108717,e57a7de65360e87c
X-Google-Attributes: gid108717,public
X-Google-Thread: fb361,e57a7de65360e87c
X-Google-Attributes: gidfb361,public
X-Google-Thread: 10dce5,e57a7de65360e87c
X-Google-Attributes: gid10dce5,public
X-Google-ArrivalTime: 2003-01-20 04:55:11 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!news1.optus.net.au!optus!spool01.syd.optusnet.com.au!spool.optusnet.com.au!not-for-mail
From: "Psybar Phreak" <gotyoubacktoo@yahoo.com>
Newsgroups: alt.comp.programming,aus.students,comp.programming
References: <3e2bbf5d$0$7813$afc38c87@news.optusnet.com.au>
Subject: Re: need help - formatting input
Date: Mon, 20 Jan 2003 23:52:20 +1100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Lines: 41
Message-ID: <3e2bf105$0$7815$afc38c87@news.optusnet.com.au>
NNTP-Posting-Host: 211.28.166.123
X-Trace: 1043067141  7815 211.28.166.123