If you do not want to use std::string or any other standard containers, as if was suggested earlier, you have basically two choices:
Straight forward one - allocate buffer in advance, big enough to store the input
std::cout << "Input a word: ";
char ch_array[100];
std::cin >> ch_array;
Much complicated one - read the input by symbol and reallocate the memory
Of Cause the reallocation casts a lot. And I do not suggest to use it, until the memory is extremely limited resource and you cannot spend even an extra byte of data. Just to show how complicated it can be:
char* ch_array;
static int count = 0;
char c = getchar();
while(c != '\n')
{
if( count == 0)
ch_array = static_cast<char*>( malloc( sizeof(char)+1 ) );
else
ch_array = static_cast<char*>( realloc(ch_array, sizeof(char)*(count+2) ) );
ch_array[count] = c;
count++;
c = getchar();
}
ch_array[count] = '\0';
In this code error checks are also skipped which are absolutely necessary for the reallocation. With them, it will be even more complicated
As for the smart pointer, which is in the title, but seems unrelated to the question:
With the first option you can allocate the buffer on heap and use it:
std::unique_ptr<char[]> ch_array(new char[100]);
With the second you need a custom deleter, as described here Is it possible to use a C++ smart pointers together with C's malloc?