How do you use strings (c++) with xCode

Discussion in 'Mac Programming' started by rgwebb, Nov 27, 2005.

  1. macrumors newbie

    Nov 27, 2005
    I try using strings by including string.h...but I get scope errors when I declare a string. Whats the beef?
  2. macrumors 6502a


    Aug 22, 2003
    You need to include the proper namespace, in this case you should be using std::string or at global scope declare "using namepsace std". Everything from the stl is in the std namespace. Its like that on ever complier that i know of.
  3. macrumors 6502a

    Also #include <string> not <string.h>, the .h filenames have been deprecated.

Share This Page