Zero Memory - CSharp System

CSharp examples for System:Array Element

Description

Zero Memory

Demo Code


using System.Runtime.InteropServices;
using System.Collections.Generic;
using System;// ww w.  j ava2 s. com

public class Main{
        public static void ZeroMem(this float[] array) {
            if (array == null) {
                return;
            }
            for (var i = 0; i < array.Length; ++i) {
                array[i] = 0f;
            }
        }
        public static void ZeroMem(this byte[] array) {
            if (array == null) {
                return;
            }
            for (var i = 0; i < array.Length; ++i) {
                array[i] = 0;
            }
        }
        public static void ZeroMem(this uint[] array) {
            if (array == null) {
                return;
            }
            for (var i = 0; i < array.Length; ++i) {
                array[i] = 0;
            }
        }
        public static void ZeroMem(this int[] array) {
            if (array == null) {
                return;
            }
            for (var i = 0; i < array.Length; ++i) {
                array[i] = 0;
            }
        }
}

Related Tutorials