Is is safe to do so?Code:char* stupid = getenv("HOME"); string filepath = stupid; cout << "Your home directory are " << filepath << endl;
I have to use char pointer because compiler complain if I use char array because compiler cannot know the size of char array. I mean, I have to be very careful if I have to deal with pointer.
so
string = char pointer;
Is it safe??????
Or is there a better way inisialize string c++-style from string c-style?