Thread: Conversions

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    9

    Exclamation Conversions

    Hello, if anyone can help me with this problem, I will really appreciate it. Okay! Is it possible to convert string to any other data type, such as int, float, or double? If there is, can you point me in the right direction? Just a little background information: I am reading in a string from a file, dividing it accordingly, but I need to use some components of the divided string within my program. I hope I have provided you with enough information to help me with my problem. Thanks in advance!!!

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Consider these C-style functions.

    atoi()
    atof()

    Kuphryn

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    9
    are those commands from C++?

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Those functions are part of the c-library that comes with C++ library.

    Kuphryn

  5. #5
    Registered User
    Join Date
    Sep 2002
    Posts
    9
    Can you tell me what their names are? I am unfamiliar with those functions and would feel uncomfortable using them. I know this is a lot to ask of you, but are there other conversion methods you can tell me and where can I find them?

  6. #6
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Here is one C++ reference website.

    http://www.cplusplus.com/ref/

    Kuphryn

  7. #7
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    In what Library are the atoi(), and atof().

  8. #8
    stdlib.h

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Arithmetic conversions
    By wilksdr in forum C Programming
    Replies: 4
    Last Post: 10-02-2005, 09:10 PM
  2. why are enum type conversions disallowed?
    By krygen in forum C++ Programming
    Replies: 11
    Last Post: 11-24-2004, 11:22 AM
  3. type conversions
    By kocika73 in forum C Programming
    Replies: 2
    Last Post: 10-06-2004, 09:45 AM
  4. Head Banging Floating Point Conversions
    By Davros in forum C++ Programming
    Replies: 9
    Last Post: 02-23-2004, 09:23 AM
  5. Conversions
    By Bones in forum C++ Programming
    Replies: 4
    Last Post: 09-01-2003, 09:59 AM