You should probably show more code, like the declaration of search.name and strlength, as well as what headers you are including. Also, I assume you are using g++ to compile.
This code seems to work just fine:
Code:
#include <iostream>
using namespace std;
const int strlength = 80;
int main()
{
char name[strlength];
cout << "please enter this student's full name:\n>";
cin.getline(name,strlength);
}
Incidentally, the standard string version of that code is this:
Code:
#include <iostream>
#include <string>
int main()
{
std::string name;
std::cout << "please enter this student's full name:\n>";
std::getline(std::cin, name);
}