Small nit:
"Niz" <ni*@nicetry.comwrote in message
news:2008050513182216807-niz@nicetrycom...
On 2008-05-05 12:23:26 +0100, ap******@gmail.com said:
> printf("Social security number (no hyphens, just 3 figures): ");
Three figures? All the SSN's I've seen are nine.
Did I miss something earlier in the thread where you wanted only three digit
portion of the SSN? If so, it seems the prompt should say so.
Also, I thought it wasn't guaranteed (assured? assumed?) that any output
would occur without a newline or an fflush. When I did stuff like this, I
used:
printf("Social security number (no hyphens, just 9 figures): ");
fflush(stdout);
scanf("%d", ssn);
In cases where I forgot the fflush, for some platforms it worked as desired
anyway. But on others, the prompts wouldn't appear until. In most of those
cases the prompt appeared after I hit Enter for the input value, like this:
123456789Social security number (no hyphens, just 9 figures
[]
That [] represents the cursor at the beginning of the next line.
But I also remember one system where NONE of the prompts appeared at all.
Then when I did a printf, which had a newline, all the prompts showed up at
the same time, followed by the printf text. The cause being how the
c-library and/or operating system did output buffering.
- Bill