nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

C# Programmer's Reference  

++ Operator

The increment operator (++) increments its operand by 1. The increment operator can appear before or after its operand:

++ var
var ++

Where:

var
An expression that denotes a storage location or a property or an indexer.

Remarks

The first form is a prefix increment operation. The result of the operation is the value of the operand after it has been incremented.

The second form is a postfix increment operation. The result of the operation is the value of the operand before it has been incremented.

Numeric and enumeration types have predefined increment operators. User-defined types can overload the ++ operator (see operator).

Example

// cs_operator_increment.cs
using System;
class Test 
{
   public static void Main() 
   {
      double x;
      x = 1.5;
      Console.WriteLine(++x);
      x = 1.5;
      Console.WriteLine(x++);
      Console.WriteLine(x);
   }
}

Output

2.5
1.5
2.5

See Also

C# Operators | 7.5.9 Postfix increment and decrement operators | 7.6.5 Prefix increment and decrement operators