Tuesday, October 27, 2009

Most of us make problems in the meaning of ++x and x++.

The following shortcuts x++ and ++x are the examples C# makes
it possible for you to use concise syntax to manipulate data in complex
ways.when i was a student I misunderstood most of the time in
implementing the x++,++x in programming.most of the
programmers who are fresher faced this problem once.

you have to concentrate on the meaning properly.that is The first
form(x++)increments x after the expression is evaluated, and the
second form(++x)increments x before the expression is evaluated.
let us clear with a example--

x=10;
z=x++; //the value of x will be assigned to z first then value will increment
z=++x;//the value of x will be incremented first then will be assigned to z.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger