Make constant and convert 2d

I have a long random static alphameric.

I want to put into constant arr
const randomNumber [ ] =“1bweqwe213lj132"

convert it into 2d
void make2Darray (const char [][], int, int);

and format the output in such a way
"1" "b" "w"
"e" "q" "w"
I believe this is a matrix type algorithm that you will need.
Arrays operate on locations of values... to do this you will need to use your single array
as the input values into your double array.

a for loop would do this nicely...
use multiple for loops...
//number of strings in array
//size of each string
//here is my thought in code...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>

using namespace std;

int main()
{
	const int days = 7;
	const int max = 10;

	char star[days][max] = { "s", "m", "t", "w", "t", "F", "s" };

	for (int i = 0; i < days; i++)
	{
		cout << star[i] << endl;
	}

	return 0;
}


I can expand on my theory if need be... but I think this is on the right track.
Topic archived. No new replies allowed.