array
-
I want to delete the last index array value? it is possible or not? for example t is an PointF array. it contains 5 values but i need only 4 values for calculation. how to delete the last index value?
PointF[] t = {{120,200},{300,400},{500,550},{890,900},{900,900}};
i need only t[] = {{120,200},{300,400},{500,550},{890,900}}
-
I want to delete the last index array value? it is possible or not? for example t is an PointF array. it contains 5 values but i need only 4 values for calculation. how to delete the last index value?
PointF[] t = {{120,200},{300,400},{500,550},{890,900},{900,900}};
i need only t[] = {{120,200},{300,400},{500,550},{890,900}}
You can't resize an array. Copy the needed contents from this array to a new one.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
I want to delete the last index array value? it is possible or not? for example t is an PointF array. it contains 5 values but i need only 4 values for calculation. how to delete the last index value?
PointF[] t = {{120,200},{300,400},{500,550},{890,900},{900,900}};
i need only t[] = {{120,200},{300,400},{500,550},{890,900}}
You can't delete values from arrays, the only way is to recreate the array 1 size smaller and copy the values you want to keep. (Or just set the values you don't want to 0 or null and ignore them when you process the array). Best thing to do is use a generic collection. collections can be resized by calling add/delete. try:
List<PointF> t = new List<PointF>();
Simon
-
You can't resize an array. Copy the needed contents from this array to a new one.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
Just loop through the first 4 indexes...and use them for calculations.. ok..
"Programming is a fun"