Suppose you to insert or get the values from 1d array using 2d dimensions like :-Insert value at (1,2) and the value is 5 then you have to find the logic to get the index :- Firstly you have to know the size of 2d array here suppose :- (2x3)int xPosition = 1;int yPosition = 2;3 is ySize of 2d array.int 1dIndex = (3*xPosition)+ yPosition ;Insert at...
How to convert 3d array to 1d array ?
Suppose you have to insert a value at (2,1,0) and the value is :-5means firstly you have to find the index through (2,1,0) then you have to insert value 5 at that index .Logic is :-Firstly you must have to know the 3d array size suppose here is (3x2x3).int xPosition = 2;int yPosition = 1;int zPosition = 0;int indexOf1dArray = (xPosition *2*3) + ((yPosition...
What is the difference between .ToString() and Convert.ToString() ?
int value = 3;string stringConversion = value.ToString();string stringConversion = Convert.ToString(value);We can convert the integer “value ” using “value .ToString()” or “Convert.ToString” The basic difference between them is “Convert” function handles NULLS .It handles null exception while “value .ToString()”does not it will throw a NULL reference...