cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Algorithms for 2D arrays
Algorithms for 2D arrays
Mar 16, 2015 at 6:26pm UTC
mighty asker
(106)
Hello. Would you recommend me some good sources of algorithms for 2D arrays (merging, rotating, deleting rows, etc)?
P.S. What's the right way to declare an 2D array with the array library?
Last edited on
Mar 17, 2015 at 4:09pm UTC
Mar 16, 2015 at 10:36pm UTC
disturbedfuel15
(88)
Declaring a 2D array is as simple as adding [][] to your desired object type.
for example:
string myStringArray[2][4];
int myIntArray[1][3];
double myDoubleArray[3][2];
char myCharArray[1][4];
etc....
Last edited on
Mar 16, 2015 at 10:36pm UTC
Mar 17, 2015 at 4:12pm UTC
mighty asker
(106)
I meant declaring like
array<
int
>myarr;
Mar 17, 2015 at 4:40pm UTC
anup30
(968)
std::array<std::array<
int
,4>,12> data;
here data is 12x4 array of integers.
Mar 17, 2015 at 6:09pm UTC
mighty asker
(106)
And same for vectors?
Topic archived. No new replies allowed.