Tips for golfing in C++
The ternary conditional operator ?: can often be used as a stand in for simple if--else statements at considerable savings.

It is of special value in that it can be used to select alternate lvalues as in

#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
int main(int c, char**v){
  int o=0,e=0,u;
  while(--c) ((u=atoi(v[c]))%2?o:e)+=u;
  std::cout &lt;&lt; "Sum of odds " &lt;&lt; o &lt;&lt;std::endl
            &lt;&lt; "Sum of evens " &lt;&lt; e &lt;&lt;std::endl;
}