The problem you will find is that ungetc() can (and IS) used to "push back" characters other than the one that was just read. Rather than changing ungetc() and watching thing break later, you might devise new innards to sscanf(), or a special ROsscanf(), or something. -Mike Muuss