Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cbosgd.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!ihnp4!cbosgd!mark From: mark@cbosgd.UUCP (Mark Horton) Newsgroups: net.lang.c,net.unix-wizards,net.wanted Subject: Re: need info: %r in printf Message-ID: <436@cbosgd.UUCP> Date: Fri, 14-Oct-83 15:17:52 EDT Article-I.D.: cbosgd.436 Posted: Fri Oct 14 15:17:52 1983 Date-Received: Sun, 16-Oct-83 11:00:49 EDT References: <164@washu.UUCP> Organization: AT&T Bell Laboratories, Columbus Lines: 23 I think %r was in UNIX/32V (undocumented) and possibly V7. It went away in 4BSD and was never in System III or its precursors. Calling _doprnt is very unportable. In particular, System III and V don't have _doprnt, they have _print, with slightly different conventions. There are also slight differences between V7 and 32V. The next release of System V has something called vsprintf: vsprintf(string, format, ap) char *string, *fmt; va_list ap; (see varargs(3)). This is like sprintf, except that ap is something that can be passed through more than one layer of function (e.g. it's normally a pointer to the first argument in the list.) Assuming you consider System V "standard", this will be the first documented way to do this in "standard UNIX". In general, this is useful when you want to provide a printf-style routine for other routines to use. It's great for debugging and error messages. It's also useful when you want to provide a subroutine package - e.g. printw in curses.