خرید بک لینک

Vote count: 0

My code is littered with

someInt=0;

I keep constantly "resetting" my integers.

Would it be possible to implement an extension method that will set the integer to 0?

Something like this:

public static void Reset(this int num) =>num=0;

And the intended usage would be:

someInt.Reset;

However that will not work, since integer is a value type.

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 12 فروردين 1395 ساعت: 10:56

صفحه بندی