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
In this assignment, you will develop a program named "match" to be used by a dating service to form couples. Given the number of gentlemen, the number of ladies, and a list of acce

Can I drop the [] while deleteing array of some built-in type (char, int, etc)? A: No. you can't Sometimes programmers think that the [] in the delete[] p only present so the

write a class player that contain attributes for the player,s name,average and team

A constructor that accepts one argument of a dissimilar type.

# include stdio.h> # include conio.h> # include string.h> void main()   {           int i=0,j=0;           char a[100],temp;           clrscr();

Question 1 Write a program that accepts two numbers from the user and swaps the two numbers without using a temporary variable Question 2 Write a program that accepts a 3x

write a program that counts the number of occurances of the string in the n-th padovan string p(n)

search words from a passage and return snippets in html format..


Selecting Array Elements Implement the following C++ code in assembly language, using the block-structured .IF and .WHILE directives. Assume that all variables are 32-bit signed in