home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: How to limit string output length w/ stream manips?
- Message-ID: <1993Jan8.183239.10873@taumet.com>
- Organization: TauMetric Corporation
- References: <1993Jan8.025836.10039@news.ysu.edu>
- Date: Fri, 8 Jan 1993 18:32:39 GMT
- Lines: 17
-
- af458@yfn.ysu.edu (Jon K. Salmon) writes:
-
-
- >I would like to limit the output length of a string sent to an
- >output stream. For example, given a string...
-
- > const char *Bob = "1234567890ABCDEF";
-
- > ... to output "12345"?
-
- As with printf(), the iostream inserters never truncate a value; output
- width is a minimum, not an absolute.
-
- If you want to truncate a string, you have to do the truncation yourself.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
-