Rosetta Code:Village Pump/C++ edits: Difference between revisions

My take.
No edit summary
(My take.)
Line 4:
 
:: I know C++ pretty well, and I don't think his statements are right. I'll correct it as I see fit. --[[Special:Contributions/76.91.63.71|76.91.63.71]] 19:32, 7 August 2009 (UTC)
: If the '''new[]''' operator was deprecated, I haven't heard about it. For arrays, the generally accepted way to go about it is to use std::vector. boost::array is another option, if you're willing to bring in a third-party library (And that's not at all inappropriate, as far as Rosetta Code is concerned). There are and always will be scenarios in C++ where '''new[]''' is more appropriate. I can think of three different, yet equally valid, approaches for the '''cin''' issue, though. Loop through the cin>>string input sequence until a newline is hit, for example. The breakage that was described comes from non-integer values being left in the input buffer after a cin>>int, and there's a fix for that. (I don't remember what it is, though.) Buffer flush fix taken into account, the readline approach and cin>>string+convert to int approaches are just as equally valid, from a correctness standpoint. --[[User:Short Circuit|Short Circuit]] 20:09, 7 August 2009 (UTC)