cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
help with ignore
help with ignore
Mar 10, 2014 at 5:24am UTC
leahayche
(5)
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;
}
Mar 10, 2014 at 5:33am UTC
cire
(8284)
cin
is not
ins
.
Topic archived. No new replies allowed.