×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    25

    How to convert TPtrC8 to int, if TPtrC8 is a number

    How to convert TPtrC8 to int, if TPtrC8 is a number?

    Thanks

    and I want to deal with TPtrC8, like deal with string in standard c++. I want to know where to learn the method of dealing with TPtrC8.

    Thanks for anyone who help me!

  2. #2
    Registered User
    Join Date
    Nov 2004
    Location
    Oulu, Finland
    Posts
    21

    Re: How to convert TPtrC8 to int, if TPtrC8 is a number

    Use TLex8. Example:

    HBufC8* tmp = HBufC8::NewL(8);
    tmp->Des().Append(_L("123"));

    TPtrC8 ptr = tmp->Des();
    TInt tmpInt;

    TLex8 lex(ptr);
    lex.Val(tmpInt); // tmpInt is now 123
    delete tmp;

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    25

    Re: How to convert TPtrC8 to int, if TPtrC8 is a number

    It works!Thanks

Similar Threads

  1. Why Are Pre-processors Inherently Evil?
    By grahamhughes in forum Mobile Java General
    Replies: 15
    Last Post: 2009-02-12, 08:42
  2. Firmware bug or code bug displaying list on 3650
    By blackjack75 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-09-24, 19:52
  3. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52
  4. some problems with label
    By vivienzhung in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-21, 09:52
  5. Replies: 6
    Last Post: 2002-06-26, 13:33

Posting Permissions

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