Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Setprecision in a loop

Sam:


struct movie{
int week;
int month;
int year;
int rating;
};

In the loop below, I am trying to print out all the information in the vector of struct and I only want decimals in the ratings but this makes it so that there are decimals in all lines after the first iteration.


for(int i = 0; i cout cout cout cout }

Anyone know how I can fix this?

Also, if I'm not using pointers and haven't allocated dynamic memory, is it still possible to have memory leaks?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Setprecision in a loop

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×