I think the nearest C# equivalent to int*
would be ref int?
. Because ref int?
allows the called method to pass a value back to the calling method.
int*
- Can be null.
- Can be non-null and point to an integer value.
- If not null, value can be changed, and the change propagates to the caller.
- Setting to null is not passed back to the caller.
ref int?
- Can be null.
- Can have an integer value.
- Value can be always be changed, and the change propagates to the caller.
- Value can be set to null, and this change will also propagate to the caller.