+= operator in C/C++?

Solved
KiraX10A Posted messages 209 Registration date   Status Membre Last intervention   -  
Nabla's Posted messages 20731 Status Contributeur -
Hello,

Hello, well as the title says, could someone just explain to me in two or three words what the code means:
int nombreDeSecondes(int heures, int minutes, int secondes)
{
int total = 0;

total = heures * 60 * 60;
total += minutes * 60;
total += secondes;

return total;
}

This function returns a total in seconds, but how do we interpret "total += minutes" please?

Thank you in advance :)
Configuration: Windows XP Firefox 3.5.3

6 réponses

Neliel Posted messages 7012 Status Contributeur 1 702
 
+= is a way to increment.

Example:

t+=1 means t=t+1
so t+=x means t=t+x

there you go
--
Utae Gamuza
33