Skip to main content
added 27 characters in body
Source Link
user2133061
user2133061

You can define your own two dimensional array generic class, and define the constructor of the two dimensional array class to receive two integers to specify the number of rows and columns in the new two dimensional array, and define get function that receive two parameters of integer that access an element in the two dimensional array and returns its value, and set function that receives three parameters, that the two first are integers that specify the row and column in the two dimensional array, and the third parameter is the new value of the element. Its type depends on the type you chose in the generic class.

You will be able to implement all this by using either the normal c++ array (pointers or without) or the std array and use one of the ideas that other people suggested, and make it easy to use like the cli array, or like the two dimensional array that you can define, assign and use in C#.

You can define your own two dimensional array class by using either the normal c++ array (pointers or without) or the std array and use one of the ideas that other people suggested, and make it easy to use like the cli array, or like the two dimensional array that you can define, assign and use in C#.

You can define your own two dimensional array generic class, and define the constructor of the two dimensional array class to receive two integers to specify the number of rows and columns in the new two dimensional array, and define get function that receive two parameters of integer that access an element in the two dimensional array and returns its value, and set function that receives three parameters, that the two first are integers that specify the row and column in the two dimensional array, and the third parameter is the new value of the element. Its type depends on the type you chose in the generic class.

You will be able to implement all this by using either the normal c++ array (pointers or without) or the std array and use one of the ideas that other people suggested, and make it easy to use like the cli array, or like the two dimensional array that you can define, assign and use in C#.

added 27 characters in body
Source Link
user2133061
user2133061

This line of code creates a "jugged array", which is an one dimensional array that each of its cells is or points to another one dimensional array. If

If all one dimensional arrays in one dimensional array are equal in their length/size, then you can look attreat the array2d variable as a real two dimensional array, plus you can use the special methods to treat rows or columns, depends on how you view it in mind, in the 2D array, that std array supports.

You can define your own two dimensional array class by using either the normal c++ array (pointers or without) or the std array and use one of the ideas that other people suggested, and make it easy to use like the cli array, or like the two dimensional array that you can define, assign and use in C#.

This line of code creates a "jugged array", which is an array that each of its cells is or points to another array. If all arrays in one array are equal in their length/size, then you can look at array2d variable as a real two dimensional array, plus you can the special methods to treat rows or columns, depends on how you view it in mind, in the 2D array, that std array supports.

You can define your own two dimensional array class by using either the normal c++ array (pointers) or std array and use one of the ideas that other people suggested, and make it easy to use like the cli array, or like the two dimensional array that you can define, assign and use in C#.

This line of code creates a "jugged array", which is an one dimensional array that each of its cells is or points to another one dimensional array.

If all one dimensional arrays in one dimensional array are equal in their length/size, then you can treat the array2d variable as a real two dimensional array, plus you can use the special methods to treat rows or columns, depends on how you view it in mind, in the 2D array, that std array supports.

You can define your own two dimensional array class by using either the normal c++ array (pointers or without) or the std array and use one of the ideas that other people suggested, and make it easy to use like the cli array, or like the two dimensional array that you can define, assign and use in C#.

added 27 characters in body
Source Link
user2133061
user2133061

But still std array are one dimensional array, like the normal c++ arrays. But thanks to the solutions that the other guys suggest, about how you can make the normal c++ one dimensional array to two dimensional array, we can adapt the same ideas to std array, e.g. according to Mehrdad Afshari's idea, we can write the following code:

array<array<int, 3>, 2> array2d = array<array<int, 3>, 2>();

array<array<int, 3>, 2> array2d = array<array<int, 3>, 2>();

This line of code creates a "jugged array", which is an array that each of its cells is or points to another array. If all arrays in one array are equal in their length/size, then you can look at array2d variable as a real two dimensional array, plus you can the special methods to treat rows or columns, depends on how you view it in mind, in the 2D array, that std array supports.

But still std array are one dimensional array, like the normal c++ arrays. But thanks to the solutions that the other guys suggest, how you can make the normal c++ array to two dimensional, we can adapt the same ideas to std array, e.g. according to Mehrdad Afshari's idea, we can write the following code:

array<array<int, 3>, 2> array2d = array<array<int, 3>, 2>();

This line of code creates a "jugged array", an array that each cells is another array. If all arrays in one array are equal in their length/size, then you can look at array2d variable as a real two dimensional array, plus you can the special methods to treat rows or columns, depends on how you view it in mind, in the 2D array, that std array supports.

But still std array are one dimensional array, like the normal c++ arrays. But thanks to the solutions that the other guys suggest about how you can make the normal c++ one dimensional array to two dimensional array, we can adapt the same ideas to std array, e.g. according to Mehrdad Afshari's idea, we can write the following code:

array<array<int, 3>, 2> array2d = array<array<int, 3>, 2>();

This line of code creates a "jugged array", which is an array that each of its cells is or points to another array. If all arrays in one array are equal in their length/size, then you can look at array2d variable as a real two dimensional array, plus you can the special methods to treat rows or columns, depends on how you view it in mind, in the 2D array, that std array supports.

added 16 characters in body
Source Link
user2133061
user2133061
Loading
Source Link
user2133061
user2133061
Loading