Click here to Skip to main content
15,885,835 members
Articles / Programming Languages / VC++

basic_oformatstream Template Class

Rate me:
Please Sign up or sign in to vote.
4.93/5 (4 votes)
25 Sep 2022MIT4 min read 57.7K   835   20  
Old style printf format strings ported to an ostream shim class
Here is what you get as briefly as I can say in code. _snprintf(buf, n, "%d %u %ld %lu", i, ui, l, ul); becomes oformatstream ofs("%d %u %ld %lu", &a_string_stream); ofs << i << ui << l << ul;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Australia Australia
Developing various kinds of software using C/C++ since 1984 or so. Started out writing 8086 asm for direct screen i/o and mouse handling etc.
Used several other languages eg. Java, Python, Clipper/dBase, FORTRAN 77, Natural ADABAS, Unix scripting, etc.
Previous role involved Enterprise Content Management on Win32.
Most recently worked on managing secure code example development for an online secure code training product.
securecodewarrior.com

Comments and Discussions