Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!luth!sunic!liuida!isy!sssab!sveer From: sveer@sssab.se (Sven L Eriksson) Newsgroups: comp.std.c Subject: Escape sequences for printf() defined by SVID Keywords: escape sequences printf SVID Message-ID: <1990Jan3.144808.6319@sssab.se> Date: 3 Jan 90 14:48:08 GMT Distribution: comp Organization: Projekt Pegasus Lines: 26 Everybody knows that escape sequences like these works fine with printf printf("\thello\n") ; Usually these escape sequences are recognized and converted by the compiler. However SVID (Issue 2) states that the format string may contain these escape sequences. This implies that it is possible for the actual format string printf sees to contain the characters '\' and 'n', and still be converted into a newline. This whould be very convenient if the format string is received from elsewhere, e.g. stdin. (X/Open portability guide (issue 2) does not mention these escape sequences, but says that the printf() chapter is derived from SVID issue 1.) Is this a correct interpretation that printf() (according to SVID) should handle escape sequences or is SVID wrong? -- - Sven L Eriksson, 3S AB (Scandinavian System Support AB) - Address: Agatan 4, Box 535, S-581 05 Linkoping, Sweden - Phone: +46-13-11 16 60 Fax: +46-13-11 51 93 - Email: sveer@sssab.se UUCP: uunet!mcvax!sssab!sveer