- Posted On 31 July 2014
- In Programming
In this post I will share some information about incremental operator ++ of C#. In many interviews this question has been already asked and still it is one of the favorite question for some of the interviewers i.e. What is the difference between i++ and ++I in C#?
So let’s check what the difference is.
In both the cases value of “i” gets incremented but the difference is i++ - It’s a type of post increment. When you write i++ it means “give me the value of i and then increment its value”, on the other hand ++i means “increment the value of i and then give me the updated value”.
Let’s understand using some example.
If you write a code like below.
int i = 2; int j= 2; int k = i++; int l = ++j;
In above case, at the end, values of i,j,k and l will be like following
i = 3
j = 3
l = 3
So by above example you can easily understand how pre increment and post increment works.
If not and having some queries do share in comment section below. If you have something positive to add this short but useful post then do share that too. Thanks.
Typewriter - Automatic TypeScript Template generation from C# classes in Visual Studio
Typewriter, an extension for visual studio that generates TypeScript files from C# code files using TypeScript templates. Convert your C# model classes to TypeScript automatically.
How to call click or any event only once in jQuery
Know how to execute an click event or any event only once for any element in jQuery. Perform action only once and even not required to unbind event.
Top 10 Visual Studio things which can boost developers coding speed
Visual Studio 2012 provides some coding features by which you can code faster if use them properly. This post will cover top 10 things among them to boost your development speed.
Copy changed data in table from one database to another in SQL stored procedure
How to copy or merge changed data in table from one database to another having same schema is the topic of this post.
Swagger - Powerful Opensource Framework for RESTful API
With a Swagger-enabled API, you get interactive documentation, client SDK generation and discoverability. Swagger Editor allows you to generate code, documentation with ease.