CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: GCDEF

Search: Search took 0.14 seconds.

  1. Replies
    11
    Views
    10,294

    Re: help with looping structure

    http://msdn.microsoft.com/en-us/library/126fe14k(v=VS.80).aspx
    http://www.cppreference.com/operator_precedence.html
  2. Replies
    11
    Views
    10,294

    Re: help with looping structure

    As laserlight said, they're evaluated left to right. I'm not a big believer in superfluous parenthesis, but they won't do any harm I guess.

    As to the rounding, his result is a double, so casting...
  3. Replies
    11
    Views
    10,294

    Re: help with looping structure

    percent[j] = votes[j]/ total * 100;

    That will always be zero. Try
    percent[j] = votes[j] * 100 / total;

    If total is always zero in the loop, use the debugger to look at the values in votes.
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured