public static void PassByValue(ref ValueTypeCounter c1, RefTypeCounter c2) { c1.Inc(); c2.Inc(); CallInc(c1); CallInc(c2); }
public static int Initobj(int a) { ValueTypeCounter c1 = new ValueTypeCounter(); c1.Inc(); ValueTypeCounter c2 = new ValueTypeCounter(a); ValueTypeCounterContainer cc = new ValueTypeCounterContainer(); cc.Init(a); return(c1.Val + c2.Val + cc.c.Val); }
static void CallInc(ValueTypeCounter counter) { counter.Inc(); }