digitalmars.D - ungetc returns c?
- Ben Hinkle (5/5) May 31 2005 Anyone know why ungetc in std.stream returns the input character? I'm
- Sean Kelly (4/9) Jun 01 2005 I can't think of any reason I'd want the input character from an unget. ...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (12/20) Jun 01 2005 It does in C, so I guess that's why it does in D too.
- SeeSchloss (3/4) Jun 01 2005 char c = stream.ungetc (stream.getc ()); ?
- Ben Hinkle (3/7) Jun 02 2005 OK. might as well keep it the way it is.
Anyone know why ungetc in std.stream returns the input character? I'm thinking of changing that to void ungetc(char c) and void ungetcw(wchar c)
May 31 2005
In article <d7ipim$12t$1 digitaldaemon.com>, Ben Hinkle says...Anyone know why ungetc in std.stream returns the input character? I'm thinking of changing that to void ungetc(char c) and void ungetcw(wchar c)I can't think of any reason I'd want the input character from an unget. I say change it. Sean
Jun 01 2005
Sean Kelly wrote:It does in C, so I guess that's why it does in D too. SYNOPSIS #include <stdio.h> int ungetc(int c, FILE *stream); RETURN VALUES The ungetc() function returns the character pushed-back after the conversion, or EOF if the operation fails. So it seems the main reason for the return value in C, is to have somewhere quick to return an error code in ? --andersAnyone know why ungetc in std.stream returns the input character? I'm thinking of changing that to void ungetc(char c) and void ungetcw(wchar c)I can't think of any reason I'd want the input character from an unget. I say change it.
Jun 01 2005
On Tue, 31 May 2005 18:47:47 -0400, Ben Hinkle wrote:Anyone know why ungetc in std.stream returns the input character?char c = stream.ungetc (stream.getc ()); ? Not sure if it's really important, but it's the only use I see.
Jun 01 2005
"SeeSchloss" <ng seeschloss.org> wrote in message news:pan.2005.06.01.18.18.51.756416 seeschloss.org...On Tue, 31 May 2005 18:47:47 -0400, Ben Hinkle wrote:OK. might as well keep it the way it is.Anyone know why ungetc in std.stream returns the input character?char c = stream.ungetc (stream.getc ()); ? Not sure if it's really important, but it's the only use I see.
Jun 02 2005