post increment nesting is dangerous in c++

Revision en1, by __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++
Tags c++

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English __shivam_kumar 2022-01-13 17:33:02 315 Initial revision (published)