1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

string to double

Discussion in 'Software Development' started by calculus87, Sep 18, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. calculus87

    calculus87 Thread Starter

    Joined:
    Sep 4, 2003
    Messages:
    34
    Hello,
    Okay, I have another question for yall. I am having a little problem going from double to string.

    I am currently saving to a text file then reading it back, but I don't line this away at all. Could you show me an easier way please.

    Okay thanks for the help.
    ~Ronald
     
  2. calculus87

    calculus87 Thread Starter

    Joined:
    Sep 4, 2003
    Messages:
    34
    by the way this is C++
     
  3. cassamine

    cassamine

    Joined:
    Nov 22, 2002
    Messages:
    186
    well i made that while programming for an SMSC but that was in Visual Basic. If you want, i can provide you both way examples but not in c++.

    cassamine
     
  4. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    This might help
    Code:
    #include <iostream>
    using namespace std;
    int main(int argc, char *argv[])
    {
    int x, y;
    char *string;
    int length = 6;
    double val = 24.62941;
    string = ecvt(val,length,&x,&y);
    printf("%s ",string);
    cout<<"Decimal Point Is "<<x<<" Places Over"<<endl;
    system("pause");
    }
    
    
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/165677

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice