CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: int to CString

  1. #1
    Guest

    int to CString

    I am having memory lapses.... how do I convert int to a CString????


  2. #2
    Join Date
    Aug 1999
    Posts
    586

    Re: int to CString

    See "CString::Format()" which works just like "sprintf()"


  3. #3
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    Re: int to CString

    try this:


    CString String ;
    int Value=100 ;

    String.Format("%i",Value);




    now String is 100

    HTH
    kishk91


    [email protected]
    http://www.path.co.il
    ICQ: 13610258

  4. #4
    Join Date
    Aug 1999
    Location
    Romania, Bucharest
    Posts
    253

    Re: int to CString

    but, how can i convert a CString to int?
    thanks


  5. #5
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    Re: int to CString

    try this one:


    int x ;
    CString Value="100" ;

    x=atoi(Value) ;




    hope this helpd you...

    regards
    kishk91


    [email protected]
    http://www.path.co.il
    ICQ: 13610258

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured