« Programmation C++/Les références » : différence entre les versions

Contenu supprimé Contenu ajouté
MacGeek (discussion | contributions)
MacGeek (discussion | contributions)
Ligne 171 :
 
=== Test 2 ===
Dans ces exemple, trouver ce que le programme va afficher.
 
==== Cas 1 ====
<source lang = "cpp">
#include <stdio.h>
 
int main()
{
int b = 2;
int a = 4;
int & ref1 = b;
int & ref2 = a;
ref2 += ref1;
ref1 -= ref2;
printf("%d %d", ref2, ref1);
}
</source>
{{Boîte déroulante|titre = Solution|contenu = 6 -2}}