Sunday, August 29, 2010

Why we have ++,-- operators

In those days compiler tech was old. There was 1 instruction - increment
So we have to link this ++ with increment...

But now a days optimizer finds itself and do the things accordingly.

Now a days these have got many problems, rather than solving it.

In cpp, people use pre increment rather than post-increment because of its copying data.

add = (++a) + (++a);
i = v[i++];

No comments:

Post a Comment