I am curious as to what others think of how I went about this:
I defined a multi dimensional array, and then outputted it in the middle of a program. Instead of outputting it VIA a string, I chose to output it using programming loops, and it outputs exactly as it was declared, without the type and name.
Feedback on my form if you don't mind:
Code:
//multidimensional array
int y[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
//output the array
cout << "The array contains: ";
for(int s = 0; s < 3; s++)
{
for(int k = 0, z = 0; k < 3; k++, z++)
{
if(s == 2 && k == 2) cout << y[2][2] << "}}";
else if(s == 0 && k == 0) cout << "{{" << y[0][0] << ",";
else
{
if(k == 0) cout << "{";
cout << y[s][k] << ",";
if(k == 2) cout << "\b},";
}
}
}