RE: I Need Help With This Vector Problem 08-08-2019, 04:47 PM
#10
(08-08-2019, 04:02 AM)phyrrus9 Wrote:(08-07-2019, 08:02 PM)Drako Wrote:(08-07-2019, 08:01 PM)phyrrus9 Wrote: well that took forever
out of curiosity, since you're going the inefficient route of using cout, why are you streaming in a newline character instead of just using endl?
I started doing that a while back when I read that endl was actually inefficient. What I read, and also heard from a lot of people was that it flushes and creates a newline. Which is unnecessary.
You'd be correct on it being inefficient, but the entirety of cout is that way. As for flushing the stream though, that's what std::flush is for.
I had already built the entire program with cout so I didn't want to try and use printf. Printf is a lot faster. As for my problem, any solutions?