Path: utzoo!attcan!uunet!fernwood!apple!mips!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!emuleomo From: emuleomo@paul.rutgers.edu (Emuleomo) Newsgroups: comp.lang.c++ Subject: Is there an sprintf equivalent in iostream.h ? Message-ID: Date: 22 Oct 90 10:39:23 GMT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 29 Hi world, I have been trying to find an sprintf equivalent in to no avail. ostrstream buf; doesn't seem to do it because once you do buf.str() you are stuck and you can't do formatting to that buffer any more! char buf[254]; ostrstream strbuf(buf, sizeof(buf), ios::out) doesn't quite do it either, because you need to stuff like strbuf.seekp( ios::beg) in order to reuse buf and even when you 'write' to buf you will have to make sure that you terminate your writes with a NULL or you will be surprised when you attempt to access buf!! Luckily, TurboC++ allows me to mix and match and ; however, is this generally the case? i.e. will I get into trouble using sprintf and printf with cout << and cin >> in other C++ implementations such as cfront etc... E-mail will be *mucho* appreciated! ThanX --Emuleomo O.O. (emuleomo@yes.rutgers.edu) -- Remember! It doesn't matter if you win or lose, as long as you win!