FOR C PROGRAMMING ONLY, please!
I am confused how to do the following:
"Before any function calls, declare the array variables as follows :
1. Data type char, playerOneBoard, dimensions 10 x 10, using global constants ROWS and COLS
2. Data type char, playerTwoBoard, dimensions 10 x 10, using global constants ROWS and COLS
.... "
I have no idea how this is supposed to look, please help!!! Thank you in advance!
In order to define globals constants define them outside every function including main function. So you can define global constants after you define # directives like #include<stdio.h>.
Now if you want to define all these array globally, then define them outside of all functions just like we define constants.
So, below is the implementation.
#include<stdio.h>
const int ROWS = 10; //declaring global integer constants
const int COLS = 10;
char playerOneBoard[ROWS][COLS]; //global 2D array of type char
char playerTwoBoard[ROWS][COLS];
//Remaining part will be afterwards
main ()
{
}
Above is the format to be used. I hope you are clear now. Please comment for any clarification.
FOR C PROGRAMMING ONLY, please! I am confused how to do the following: "Before any function...