assignment advantages ???
From: Billy N. Patton (b-patton_at_ti.com)
Date: 09/08/04
- Next message: Chris \( Val \): "Re: [C++] help resolve a dilema regarding assignment of pointers"
- Previous message: Val: "Re: File Systems"
- Next in thread: Chris \( Val \): "Re: assignment advantages ???"
- Reply: Chris \( Val \): "Re: assignment advantages ???"
- Reply: Alwyn: "Re: assignment advantages ???"
- Reply: Thomas Matthews: "Re: assignment advantages ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Chris \( Val \): "Re: [C++] help resolve a dilema regarding assignment of pointers"
- Previous message: Val: "Re: File Systems"
- Next in thread: Chris \( Val \): "Re: assignment advantages ???"
- Reply: Chris \( Val \): "Re: assignment advantages ???"
- Reply: Alwyn: "Re: assignment advantages ???"
- Reply: Thomas Matthews: "Re: assignment advantages ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|