# Managing 3d in C/c++

 By: Abu Mohammed Raisuddin
 Most of the C/C++ programmer are acquainted with the use of array (in other programming language too). Usually we use 1d or 2d array for various kind of processing. But we can use 3d array for many purposes. Such that developing an event reminder, or event log, or ticket reservation software. You can manage 3d array to do these more perfectly and skillfully. Actually you can imagine a 3d array just like a 3d space with coordinate. Each cube of the 3d space is equivalent to a single unit (integer, character) of the array. I am giving an example to illustrate the management of 3d array. I told before we can use 3d array to develop an event reminder. Declare a character 3d array X[12][31][100]. Every X[n][m] is a string where we can put the event. And I say event of (m+1)th day of n+1 month is saved in X[n][m], it will reduce the complexity of the program. The indices of the event gives the date and month number of the event. 1 should be added to n and m to find the actual date and month as the indices start from 0. Now come to the point, why will we use a 3d array or above? It seems complex but if you can manage it, it would reduce your code to a great extent. Your code will be smarter and easily editable. You can use structure or union to replace the 3d array. Equivalent structure of 3d array will be awesome if you use linked list with the structure where you may need to use a huge amount of memory. But if your memory requirement is low and you need a more speedy program, it would be better if you use 3d array instead. Let us define a structurestruct tt{int a,b;char c[100];}N;and a 3d array char M[100][100][100];You put a data on N.a=1;N.b=1;N.c="Nos".And put a string on M[1][1]="Nos". Now you can see that you can directly access the srting "Nos" from the 3d array by just putting the right indices. But if you use the structure you need to see whether a=1; then if a=1 then see if b=1; if b=1 then you will find the desired string there. In the same way you can manipulate 3d array or nd array to make your program more solid.Do not try to imagine the virtual image of a 4d array or above. Just remember that all the array manipulation systems are same.