string类型可以用compare函数,如果用strcmp函数的话,可以用str.c_str()获取char*类型
if(strcmp(name[j].c_str(),name[j+1].c_str()) > 0) //或者 if( name[j].compare(name[j+1]) >0)