That''s because you aren''t using string, you are using char*. Here''s what you are looking for
#include <string> //note no .husing namespace std; //just always do this if you include//a header that doesn''t have a .hstring first; //declare a string, just like declaring and intfirst = "whoo"; //assign, no using strcpy for me!string second("hoo!"); //make a variable and initializestring third = "yipee!"; //traditional syntax for the same thingfirst+=second; //now first is "whoohoo!"second = first+" "+third; //now second is "whoohoo! yipee!"if(first==second) //no need to use strcmp do_something();if(first<second) //no need to use strcmpoh and here''s a nice one:string string_array[10];#include <algorithm>sort(string_array,string_array+10);//sorts the array//note you should be using a "vector" which is a//superior array that can resize and so much more//and the same sort function can sort both arrays and vectors//now there is a problem with string, some functions//that you will want to use take a char*, not a string.//to remedy that string has a member function c_str()string filename("data.txt");ofstream(filename.c_str());
to learn more about strings, vectors, sort, ofstream and so much more read The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis.