CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Building Interactive UIs with ASP.NET Ajax: Rebinding Client-Side Events After a Partial Page Postback
  • Speed Up Repetitive Insert, Update, and Delete Query Statements
  • Binding Data to Silverlight 4.0 Controls Using ASP.NET MVC Framework 2.0
  • ADO.NET Data Services in the .NET Framework

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 23rd, 2009, 05:37 PM
    lasha lasha is offline
    Junior Member
     
    Join Date: Jun 2009
    Posts: 7
    lasha is an unknown quantity at this point (<10)
    convert CString to foat using _ttoi

    i am converting CString to float using _ttoi


    CString p; p=("1.122");
    CString y;
    float o;
    o=_ttoi(p);
    y.Format(_T("%f"),o);
    TRACE(y);


    but answer is 1 and i need 1.122

    can anyone help me??

    Last edited by lasha; November 23rd, 2009 at 05:40 PM.
    Reply With Quote
      #2    
    Old November 23rd, 2009, 06:32 PM
    Philip Nicoletti Philip Nicoletti is offline
    Elite Member
    Power Poster
     
    Join Date: Aug 2000
    Location: West Virginia
    Posts: 7,032
    Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)Philip Nicoletti has a brilliant future (2000+)
    Re: convert CString to foat using _ttoi

    _ttoi converts to int ... try _ttof
    Reply With Quote
    Reply

    Bookmarks

    Tags
    convert, cstring, float, _ttoi
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:21 AM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.