Codeforces and Polygon may be unavailable from May 23, 4:00 (UTC) to May 23, 7:00 (UTC) due to technical maintenance. ×

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)