string string* char*该怎么处理

string string* char*
rt

------解决方案--------------------
一次为对象 ,对象指针,字符指针(也有可能是字符串的)
------解决方案--------------------
#include <iostream>
#include <cstring>
#include <string>

int main()
{
using namespace std;

char animal[20]= "bear ";
const char *bird= "fly ";
char *ps;
string *bs;

cout < <animal < < " and " < <bird < <endl;
cout < < "enter a kind of animal: ";
cin> > animal;

ps=animal;
cout < <ps < <endl;

cout < < "before using strcpy(): " < <endl;
cout < <animal < < " at " < <(int *)animal < <endl;
cout < <ps < < " at " < <(int *)ps < <endl;

cout < < "after using strcpy(): " < <endl;
ps= new char[strlen(animal)+1];
strcpy(ps,animal);
cout < <animal < < " at " < <(int *)animal < <endl;
cout < <ps < < " at " < <(int *)ps < <endl;

cout < < "other situation: " < <endl;
bird=animal;
cout < <bird < < " at " < <(int *)bird < <endl;
bird=ps;
cout < <bird < < " at " < <(int *)bird < <endl;

cout < < " there is no need to give sapce to bs: " < <endl;
bs= (string *)animal;
cout < <(std::string *)bs < <endl;
bs= (string *)bird;
cout < <bs < <endl;

delete []ps;
return(0);
}
看看这个例子就懂了