• Why ++i is faster than i++?

    It is a very common question asked in most of the interviews. That's why I am not writing the name of any specific company.

    It is true that prefix operator is faster than postfix operator because in case of postfix operator
    Value of variable is copied in memory , operation is performed and then increment is done.
    While in case of prefix operator no extra storage is needed.
    Hence it is memory extensive and faster as compare to postfix operator.
    But use prefix operator with care.


    GUYS IF YOU REALLY LIKE THE POSTS OF THIS BLOG THEN PLEASE JOIN OUR BLOG.
    AND HELP US TO PUT MORE POSTS LIKE THIS.
    PLEASE HIT THE LIKE BUTTON BELOW


0 comments:

Post a Comment