mardi 31 janvier 2017

Addition and Increment expression in [ ] - operator

According to the standard are the following two expressions undefined behavior ?

int a = 1, b = 1; 
int c[] { 1, 2, 3, 4, 5 }; 

// Do the following expressions lead to Undefined Behavior ? 
c[a++]; // (1)  
c[a+b]; // (2) 

Aucun commentaire:

Enregistrer un commentaire