help with ignore

Why does this work

istream & operator >> (istream & ins, Grade & G)
{
ins >> G.category >> G.date >> G.possible >> G.received;

getline(ins,G.name);

return ins;
}

and this doesn't?

istream & operator >> (istream & ins, Grade & G)
{
ins >> G.category >> G.date >> G.possible >> G.received;
cin.ignore(); // I only want this to ignore the white space before my getline
getline(ins,G.name);

return ins;
}
cin is not ins.
Topic archived. No new replies allowed.