index # - , , .
If you imagine this as a procedure instead of an operator, the procedure will look like this:
public int Increment(int value)
{
int returnValue=value+1;
return returnValue;
}
C ++, however, works with an object reference, so the procedure will look like this:
int Increment(int &value)
{
value=value+1;
return value;
}
Note: if you applied the operator to an object (for example, you overloaded the ++ operator), then C # will behave like C ++, since the types of objects are passed as links.
source
share