assignment advantages ???

From: Billy N. Patton (b-patton_at_ti.com)
Date: 09/08/04


Date: Wed, 08 Sep 2004 07:47:12 -0500

In the book I'm reading to lean c++
It has this assignment
int a_sum = 0 , v_sum = 0;

I do it in c as:
int a_sum = v_sum = 0;
OR
int a_sum; // for the summation from the array
int b_sum; // for the summation from the vector
a_sum = 0; // needs to be 0
b_sub = 0; // needs to be 0

Was this just personal preference of the author or is there and
advantage to using comma seperated statements?

I realize that in a program where this is done once, it wouldn't matter.
But if this were in a funcion that is called millions of times then
speed could become a factor.

-- 
    ___  _ ____       ___       __  __
   / _ )(_) / /_ __  / _ \___ _/ /_/ /____  ___
  / _  / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/   \_,_/\__/\__/\___/_//_/
            /___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455,  b-patton@ti.com