|
-
August 3rd, 2010, 08:49 AM
#13
Re: A question regarding *s++
 Originally Posted by Lindley
Sure it would, given the post-increment semantics which are at the heart of what we're discussing.
 Originally Posted by itsmeandnobodyelse
StringIterator& operator++(int)
{
pos++;
return *this;
}
The real problem is that you implemented post-increment as pre-increment, breaking standard conventions and assumptions.
I'm pretty sure 4 or 5 people will tell you the same in a 5 minute time span.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|