Why there is no difference in number of times loop run when using ++i vs i++?

Revision en1, by aviabhinn98, 2021-04-21 17:24:48

for(int i=0;i<n;i++) { }

vs

for(int i=0;i<n;++i){ }

Both these loop run n times but we know that ++i and i++ are different. So can anyone explain what is happening in backend in gcc compiler using cpp? Thanks in advance

Tags #cpp, for loop

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aviabhinn98 2021-04-21 17:24:48 310 Initial revision (published)