How to make some specific strings

This is a discussion on How to make some specific strings within the C++ Programming forums, part of the General Programming Boards category; Hi, I am really new with c++. I need to make some strings like "X00001", "X00002", ..... up to "X05000". ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    4

    How to make some specific strings

    Hi,
    I am really new with c++. I need to make some strings like "X00001", "X00002", ..... up to "X05000".
    I feel this is really an easy task!
    Can anybody please help me to do so?
    Thanks
    Hash

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    What you really need is a really good, free C++ book to download. Otherwise, you're going to be back every five minutes with another basic question. Your question indicates that you've done almost zero research on your own so far.

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    You can convert integers into strings with the help of stringstreams.

    The I/O streams also have manipulators of which setfill and setw might be relevant to this task.
    Basically, if you can print strings such as that with cout, you practically have the code that is needed to send them to strings instead of console output.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 10:45 AM
  2. Removing Specific Characters from Strings
    By gfmartin05 in forum C++ Programming
    Replies: 4
    Last Post: 02-09-2009, 09:53 AM
  3. BSD make and GNU make problem
    By Skarr in forum Linux Programming
    Replies: 4
    Last Post: 09-10-2002, 01:31 PM
  4. Replies: 2
    Last Post: 05-05-2002, 02:38 PM
  5. how to make files
    By quiksilver9531 in forum C++ Programming
    Replies: 6
    Last Post: 02-22-2002, 06:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21