I have tried a program in which I wrote a function to get name from user and then I want to return that user name to main program.
When I execute it will ask to enter name but don't display it as per main program.
The name array is a local variable inside the get_name function so as soon as the function ends the name array will no longer exist. That means the function returns a pointer to something that no longer exist and that is why you have problem printing it out on the screen.
The simplest solution is to use std::string from the <string> header instead of a char array.
std::string is safer. Using a character array risks buffer overflow. e.g. "C_plus_plus" requires 12 characters, 11 for the text plus 1 for the null terminator. One could guard against that by doing
std::cin >> std::setw(10) >> name;
but overall the C++ std::string is easier to use as well as safer.