English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I would search, but no search engine will read symbols apparently.

For instance:

int sum = 0;

for ( int i = 0; i < ROWS; i++ )
for ( int j = 0; j < COLUMNS; j++ )
sum += a[i][j];

what does the += mean when it says sum += ...etc?

Thanks!

2006-12-06 07:59:02 · 6 answers · asked by antheia 4 in Computers & Internet Programming & Design

6 answers

"sum += ... " is a shorthand notation in many programming languages that means the same as "sum = sum + ..." from your example.

Basically it add the right hand expression to the left hand variable.

There is also -= and in some languages even *= and /= that do basically the same, but with different operations.

2006-12-06 08:04:30 · answer #1 · answered by anonymous 3 · 2 0

(int first, int second) are the parameters for the gcd approach. they're used to outline parameters for the approach at the same time as it truly is called. the go back area only returns the parameters to the caller when they're set contained in the approach. it truly is a worry-free getter/setter approach for what i anticipate is a best common denominator calculation. You call the gcd approach, providing it the first and second numbers, and it returns the gcd.

2016-11-24 19:21:17 · answer #2 · answered by fette 4 · 0 0

It translates to:

sum = sum + a[i][j];

2006-12-06 08:09:26 · answer #3 · answered by Anonymous · 0 0

a += b

is the same as

a = a + b;

make sense?

2006-12-06 08:03:03 · answer #4 · answered by danieltalsky 2 · 1 0

I am a graphic designer not a coder

2006-12-06 08:01:52 · answer #5 · answered by Anonymous · 0 5

http://www.good-tutorials.com/
http://www.digitaljuice.com/
http://www.tutorialkit.com/
http://www.codestyles.com/
http://www.sitecube.com/website/promo_bw.asp?pid=sitetarget

2006-12-06 08:02:33 · answer #6 · answered by george r. n. 5 · 0 2

fedest.com, questions and answers