Thread: How do I

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    4

    How do I convert an integer to a string?

    I am trying to convert an int to a string I used itoa() on my Borland compiler, but on my schools VisualAge C++ Professional / C for AIX Compiler, Version 5 running on a Unix server this function is not in the stlidb(). So is the only way to copy an integer to a string is to do a bitwise copy?
    Last edited by rmlove; 10-29-2003 at 10:31 PM.

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Look up stringstreams.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    4
    Thanks, saved me alot of pain of doing bit by bit copying
    Last edited by rmlove; 10-30-2003 at 01:21 AM.

  4. #4
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Originally posted by rmlove
    Thanks, saved me alot of remebering what my instructor has said..
    When you say something like that, do you realize how stupid you sound? Seriously, dude. Noobies without any sort of intellectual independence are really starting to ........ me off. Search the board before posting, and STFW, RTFM, read your farking textbook, pay attention in class.

    *walks away ranting*
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  5. #5
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Originally posted by joshdick
    When you say something like that, do you realize how stupid you sound? Seriously, dude. Noobies without any sort of intellectual independence are really starting to ........ me off. Search the board before posting, and STFW, RTFM, read your farking textbook, pay attention in class.

    *walks away ranting*
    cool down boy

Popular pages Recent additions subscribe to a feed