As it is, you have to use some method of copying the string into your name structure member. If it were simply a char pointer you could allocate memory in the function and return it.
Code:
// No error checking done
char* getName(size_t length)
{
char* mem = new char[length];
cout<<"Enter a name: "<<flush;
cin.getline(mem, length, '\n');
return mem;
}
...
member[i].name = getName(12); // Don't forget to delete later
As it is you need to do something more like this:
Code:
void getName(char* mem, size_t length)
{
cout<<"Enter a name: "<<flush;
cin.getline(mem, length, '\n');
}
...
getName(member[i].name, 12);
If you haven't noticed, to return a C string or pass one to a function, you use char*. Of course in C++ it's much better to use the std::string class instead.