On Jul 7, 9:29 am, John Gordon <gor...@panix.com> wrote:
> In <eab46c07-89fa-43e1-a2ec-b44b69fcb...@x41g2000yqd.googlegroups.com> LJ <djtheshowstop...@gmail.com> writes:
>
> > K&R says that the scanf format string may contain ordinary characters,
> > which are expected to match the next non-white space character of the
> > input stream.
> > However when I am reading the date given as 25 /
> > 12 / 1988 using scanf( "%d/%d/%d", &day, &month,
> > &year ); it is only reading the day. Why is it not reading the month
> > and year??
>
> Probably because your input contains spaces which the format string wasn't
> told to look for.
>
> --
> John Gordon A is for Amy, who fell down the stairs
> gor...@panix.com B is for Basil, assaulted by bears
> -- Edward Gorey, "The Gashlycrumb Tinies"
That doesn't answer my question, '/' should match the next non-
whitespace character and in input that character is '/' only, so scanf
shud read all the three dates