Thanks it's perfectly clear now. I actually knew that but it didn't look
immediately obvious.
On Monday, August 14, 2017 at 2:51:13 PM UTC+2, Konstantin Khomoutov wrote:
>
> On Mon, Aug 14, 2017 at 05:43:04AM -0700, Doğan Kurt wrote:
>
> > > Consider combining using the bufio package and scanni
On Mon, Aug 14, 2017 at 05:43:04AM -0700, Doğan Kurt wrote:
> > Consider combining using the bufio package and scanning form a buffered
> > reader using fmt.Fscanf().
>
> Great worked like a charm. I just thought i couldn't pass *bufio.Reader to
> Fscanf which takes io.Reader.
Oh, then that'
>
> Consider combining using the bufio package and scanning form a buffered
> reader using fmt.Fscanf().
>
Great worked like a charm. I just thought i couldn't pass *bufio.Reader to
Fscanf which takes io.Reader.
--
You received this message because you are subscribed to the Google Groups
"
On Mon, Aug 14, 2017 at 05:09:00AM -0700, Doğan Kurt wrote:
> I want to do something analogous to this C code.
>
> c = getchar()
>
> if (isdigit(c)) {
> ungetc(c, stdin);
> scanf("%d", &num);
> }
>
> In fmt package, fmt.Scanf("%d", &num) exists but ungetc doesn't exist. For
> bufio package, Pe
I want to do something analogous to this C code.
c = getchar()
if (isdigit(c)) {
ungetc(c, stdin);
scanf("%d", &num);
}
In fmt package, fmt.Scanf("%d", &num) exists but ungetc doesn't exist. For
bufio package, Peek function exists which is great but there is no ReadInt.
Is there an elegant so