efficient char* to string?

Discussion in 'C++' started by AutoC, Aug 29, 2010.

  1. AutoC

    AutoC New Member

    Joined:
    Aug 29, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi.

    I have a character array of the form "0abcdef" or "1defghi". I have to remove the first character and convert the rest to a string. So in this case, the strings would be abcdef and defghi.

    I know that saying string s(char array) does a direct conversion but I need to know how to do the split and conversion efficiently(without copying into another array)

    -AutoC
     

Share This Page

  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