Describe faster ++i or i++, where i is an interger variable?, C/C++ Programming

A: The answer to this lies actually, how they used. Along ++i(PreIncrement) the variable is incremented and new value is returned. Thus it needs one instruction to increment the variable.

In case of i++(post Increment), the old value need to be returned or used in the expression and after that the variable is incrememented after the expression is evaluated. As you require one instruction to save the old value to be utilized in the expression and other instruction to increment the variable, its slower comparatively.

 

Posted Date: 3/21/2013 7:40:06 AM | Location : United States







Related Discussions:- Describe faster ++i or i++, where i is an interger variable?, Assignment Help, Ask Question on Describe faster ++i or i++, where i is an interger variable?, Get Answer, Expert's Help, Describe faster ++i or i++, where i is an interger variable? Discussions

Write discussion on Describe faster ++i or i++, where i is an interger variable?
Your posts are moderated
Related Questions
C Program to check PRIME NUMBERS   main() {           int i,k,r,flag;           clrscr();           printf("ENTER THE NO. TO CHECK IT IS PRIME OR NOT: ");

Program is to take two arguments and returns the string: Program is to take two arguments and returns the string which is larger the larger string has larger ascii value invok

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Aim: To implement a program to convert distance given in feet and inches into meters and centimeters and vice versa. Code:                         class mcm; class

Aim: To implement a program to maintain information of employees in an educational institute using inheritance. Code:                       class staff {

Input Format: First line starts with T, which is the number of test cases. Each test case contains a string (S). Output Format: For each test case print the minimum number of ch

program coding for the conversion of string to a palindrome

I need plugin for amibroker using c++ Project Description: Need to prepare plugin for amibroker using c++. Should be system bound after installing. System should show based o

Various ways of initializing the Arrays. - The for loop initializes 10 elements with the value of their index.      void main()     {                 const in