1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

how to convert CFString to c++ string

Discussion in 'Mac Programming' started by chidambaram, Apr 8, 2008.

  1. macrumors member


    I am working in a carbon c++ application using XCode.

    How can i convert CFString to c++ string?

    thanks in advance and urgent plz...
  2. Moderator


    Staff Member

    Use one of the well document functions like this to turn it into an array of characters then convert that to a C++ String object?
  3. macrumors 68040



    This will get you a char *, the step from there to std::string is short. There may be a more direct way, but this should work. I'd make a function that returns a string that does all that.


Share This Page