| www.delorie.com/archives/browse.cgi | search |
| From: | "bowman" <bowman AT montana DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| References: | <HhOCsDAf$YN3EwuI AT dunvegan1 DOT demon DOT co DOT uk> <0jzu8AArMaN3EwpJ AT dunvegan1 DOT demon DOT co DOT uk> |
| Subject: | Re: Converting numbers to strings |
| Lines: | 27 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 5.00.2014.211 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2014.211 |
| Message-ID: | <UTmZ2.2585$mW3.16026@newsfeed.slurp.net> |
| Date: | Sun, 9 May 1999 15:12:20 -0600 |
| NNTP-Posting-Host: | 208.26.212.77 |
| X-Trace: | newsfeed.slurp.net 926284404 208.26.212.77 (Sun, 09 May 1999 16:13:24 CDT) |
| NNTP-Posting-Date: | Sun, 09 May 1999 16:13:24 CDT |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Paul Richards <Paul AT dunvegan1 DOT demon DOT co DOT uk> wrote in message
news:0jzu8AArMaN3EwpJ AT dunvegan1 DOT demon DOT co DOT uk...
>
> How do I do that in C++?
-----------------------------------
snip ------------------------------------
#include <iostream>
#include <strstream>
#include <iomanip>
int main() {
ostrstream ostr;
for (int i=0; i<20; i++) {
ostr << "pic" << setfill('0') << setw(3) << i << ".bmp" << ends;
cout << "filename = " << ostr.str() << endl;
ostr.seekp(0);
}
return 0;
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |