How char array converted to string whereas here it is showing error?

#include
#include
using namespace std;
int main() {
char c[]=“hello wrold!”;
string *ptr;
ptr=(string)c;
cout<<ptr<<" "<<ptr.length();
}