digitalmars.D - ungetc returns c?
- "Ben Hinkle" <ben.hinkle gmail.com> May 31 2005
- Sean Kelly <sean f4.ca> Jun 01 2005
- SeeSchloss <ng seeschloss.org> Jun 01 2005
- "Ben Hinkle" <bhinkle mathworks.com> Jun 02 2005
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: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.
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 ? --anders
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: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.
OK. might as well keep it the way it is.
Jun 02 2005









=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> 