post increment nesting is dangerous in c++

Правка en1, от __shivam_kumar, 2022-01-13 17:33:02

you cannot do nesting of post-increment operator whereas pre-increment nesting does not cause any problem

conclusion : never do post increment nesting

eg :

int a = 10;

 cout<<(++(++a))<<"\n";// valid in c++

 cout<<((a++)++); // in-valid in c++
Теги c++

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский __shivam_kumar 2022-01-13 17:33:02 315 Initial revision (published)