getting an string input through char* : I am completely confused about a taking an string input in C++.

    char str[4];
    cin>>str;
    cout<<str;

works. but the

    char* str;
    cin>>str;
    cout<<str;

doesn't work.
why?