Ok, in the tutorial about arrays, it said to picture it like this:
(then it had boxes)
I'm a little confused on the two-dimensional arrays. It said you could use them to make things like tic tac toe games. Well, how would you go about doing that?
This is a discussion on Arrays... within the C++ Programming forums, part of the General Programming Boards category; Ok, in the tutorial about arrays, it said to picture it like this: (then it had boxes) I'm a little ...
Ok, in the tutorial about arrays, it said to picture it like this:
(then it had boxes)
I'm a little confused on the two-dimensional arrays. It said you could use them to make things like tic tac toe games. Well, how would you go about doing that?
in the simplest explaination:
multidemsional arrays are just arrays of arrays
so if i did this
char array[2][3];
it would be 2 arrays of 3 char's each.
get it?
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
alright, but is it possible to make a tic tac toe game with the information is tutorials 1 through 9?
actually, i can't say i havn't read them, but i don't doubt it.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
You should be able to. It won't be anything fancy, but you could use a array of chars to hold the positions of the pieces etc.
Ramble on...
Ok i have this question for you guys!!!
a b
*************
* 1 * 2 *
* 2 * 4 * <<<< Array 1
* 3 * 8 *
* 4 * 0 *
* 5 * 2 *
*************
* 1 * a *
* 2 * b * <<< Array 2
* 3 * c *
* 4 * d *
* 5 * e *
*************
I want to make a cpp program that will combine those array and make another array with 4 columns but my problem is how could i combine both char and integer into one array.
Use a struct/class -
struct data
{
char a;
int b;
};
Then create an array of data's.
zen