Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    Code without explanations doesn't help! Commented Aug 26, 2014 at 15:18
  • @anatolyg I just have updated and commented most important changes. Sean, please, take a look to last changes. Commented Aug 26, 2014 at 15:25
  • This code might work, but it's not good code. Kindly consider editing it and providing explanations and doing correct revisions. Working answer is not the same as a good answer. Your inconsistent use of std::endl and endl alone is bad practice. Would give a +1 if it was cleaned up. Commented Aug 26, 2014 at 15:28
  • @Nanashi Sorry, the std::endl was simply a forgotten std:: to clean up. Commented Aug 26, 2014 at 15:32