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
switch statement

Illustrate the Function Definition? The C code that explains what a function does is called the function definition. A function definition has the following form Type fun

Incomplete types refer to pointers in which there is no availability of the execution of the referenced location or it points to some location whose value is not available for modi

Question 1 Explain Abstract data types with its characteristics Question 2 Let us say your Learning Centre decides to store all the three types of student data Register

Objective of this Program: (a) To learn more about modularization of a program into independent modules, (b) To use arrays in a program, (c) To get some experience with us

Project Description: I want an app that the user can download it from the play store and use it as a keyboard for texts and writing. Just like the Samsung keyboard and the arabi

make use of class objects two calculate average

Create a C language code, only one program, to implement the following task. Task: Write C code for a program that implements a digital clock (HH:MM:SS). The clock inclu

given integer ''n'' and permutation of numbers 1,2,..n-1, c program to print permutation that lexicograghically precedes given input permutation if permutation is least print input

Access to the channel/devices is achieved by means of general purpose I/O routines Theses are standard functions described in stdio.h header file namely getc and putc. Getc and put