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

Thread: CString

  1. #1
    Guest

    CString

    how can I convert a string (say:CString strNumber = '12' into an integer (int nNumber = 12


  2. #2

    Re: CString

    call normal sscanf function giving CString as a first input parameter


  3. #3

    Re: CString

    or maybe better _stscanf


  4. #4
    Guest

    Re: CString

    Try int nNumber = atoi(strNumber.GetBuffer(0));


  5. #5
    Join Date
    May 1999
    Posts
    5

    Re: CString

    Use nNumber = atoi(strNumber);
    It will convert string to Integer.

    Use itoa(nNumber,chrNumber,10);
    strNumber = chrNumber;
    It will convert Number to string.
    where chrNumber is an array like
    char chrNumber[10];



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