Re: sscanf question
On Sun, 3 Aug 2008 14:25:15 -0700 (PDT), vippstar@gmail. com wrote:
Well, you said '\0' characters would pose some difficulty. He said
they wouldn't.
So let's start at the beginning. Why do you think they prevent robust
code from using scanf? Before you answer, I suggest you look through
the archives for posts by Dan Pop that describe exactly how to do
this.
--
Remove del for email
On Sun, 3 Aug 2008 14:25:15 -0700 (PDT), vippstar@gmail. com wrote:
>On Aug 3, 4:27 pm, CBFalconer <cbfalco...@yah oo.comwrote:
>
>What are you talking about?
>vipps...@gmail .com wrote:
>>
>>
>>
>>
>So? A null byte is not a digit, nor a period, so it will normally
>be treated as marking the end of a numeric field.
Chris Torek <nos...@torek.n etwrote:
<snip>
>(It is possible, but somewhat difficult, to "read a line" with
>the scanf family. The code to do this is somewhat obscure. It
>does appear here in comp.lang.c now and then.)
>the scanf family. The code to do this is somewhat obscure. It
>does appear here in comp.lang.c now and then.)
I'd say it's impossible in robust code; the stream can have
unwanted embedded null bytes, which scanf will happily read.
unwanted embedded null bytes, which scanf will happily read.
>So? A null byte is not a digit, nor a period, so it will normally
>be treated as marking the end of a numeric field.
>What are you talking about?
they wouldn't.
So let's start at the beginning. Why do you think they prevent robust
code from using scanf? Before you answer, I suggest you look through
the archives for posts by Dan Pop that describe exactly how to do
this.
--
Remove del for email
Comment